package com.service;

import static com.def.GenericDef.E_READ_NOT_FOUND;
import static com.def.GenericDef.E_RET_BOX;
import static com.def.GenericDef.E_RET_PRD_INFO;
import static com.def.GenericDef.E_RET_WO;
import static com.def.GenericDef.E_XPINQDEF_INVALID_INPUT;
import static com.def.GenericDef.E_XPINQDEF_INVALID_PROC_ID;
import static com.def.GenericDef.RETURN_CODE_OK;
import static com.def.GenericDef.RETURN_CODE_SET_ERROR;
import static com.def.GenericDef.RETURN_CODE_UNKNOWN;
import static com.def.GenericDef.RETURN_MESG_OK;
import static com.def.GenericDef.T_XPINQDEF;
import static com.def.GenericDef._NORMAL;
import static com.def.GenericDef._SPACE0;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

import com.tx.Xpinqdef.*;
import org.apache.log4j.Logger;
import org.hibernate.LockMode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import org.springframework.transaction.interceptor.TransactionAspectSupport;

import com.dao.IBisDataDao;
import com.dao.IRetBoxDao;
import com.dao.IRetPrdInfoDao;
import com.dao.IRetPrdJgeDao;
import com.dao.IRetWODao;
import com.dao.IBisMdlDefDao;
import com.icim.service.ICIMBaseService;
import com.model.Bis_data;
import com.model.Ret_box;
import com.model.Ret_prd_info;
import com.model.Ret_prd_jge;
import com.model.Ret_wo;
import com.model.Bis_mdl_def;
import com.rtnBean.SimpleRtnBeen;
import com.util.MqOpe;
import com.util.Util;

@Scope("prototype")
@Service("XpinqdefService")
public class XpinqdefService extends ICIMBaseService{
	private static Logger logger = Logger.getLogger(XpinqdefService.class);
	private static String TX_NAME = T_XPINQDEF;

	private XpinqdefI inTrx;
	private XpinqdefO outTrx;

	@Autowired
	private IRetPrdInfoDao retPrdInfoDao;
	@Autowired
	private IRetWODao retWoDao;
	@Autowired
	private IRetPrdJgeDao retPrdJgeDao;
	@Autowired
	private IRetBoxDao retBoxDao;
	@Autowired
	private IBisDataDao bisDataDao;
	@Autowired
	private  IBisMdlDefDao bisMdlDefDao;

	private String gszMsgBuf = "";
	
	private double l_def_cnt = 0;
	private double p_def_cnt = 0;
	private double d_def_cnt = 0;//待确认不良数
	private double proc_yield = 0;
	private double whole_yield = 0;
	private Integer modelCnt = 0;
	private String maxSlotNo = "1";
	private double g_yjyc_cnt = 0;//液晶异常

	public String subMainProc(String strInMsg) {
		long rtnCode = _NORMAL;
		gszMsgBuf = "";
		String outMsg = "";
		inTrx = new XpinqdefI();
		outTrx = new XpinqdefO();
		outTrx.setTrx_id(TX_NAME);
		outTrx.setRtn_code(String.valueOf(RETURN_CODE_SET_ERROR));

		MqOpe mqOpe = new MqOpe();

		try {
			inTrx = (XpinqdefI) mqOpe.inStr2Obj(strInMsg, inTrx);
			logger.info("InTrx is " + strInMsg);

			rtnCode = subMainProc2(inTrx.getAction_flg().toCharArray()[0]);
			if (rtnCode != _NORMAL) {
				outTrx.setRtn_code(String.valueOf(rtnCode));
				outTrx.setRtn_mesg(gszMsgBuf);
				TransactionAspectSupport.currentTransactionStatus()
						.setRollbackOnly();
			} else {
				outTrx.setRtn_code(String.valueOf(RETURN_CODE_OK));
				outTrx.setRtn_mesg(RETURN_MESG_OK);
				retPrdInfoDao.flushCurSession();
			}
		} catch (Exception ex) {
			outTrx.setRtn_mesg(ex.toString());
			outTrx.setRtn_code(RETURN_CODE_UNKNOWN);
			logger.error(Util.stackTraceToString(ex));
			TransactionAspectSupport.currentTransactionStatus()
					.setRollbackOnly();
		} finally {
			outMsg = mqOpe.obj2Str(outTrx);
		}
		return outMsg;
	}

	private long subMainProc2(char actionType) {
		long rtnCode = _NORMAL;

		switch (actionType) {
		case 'Q': {
			rtnCode = getPrdDefInfo();
			break;
		}
		case 'O': {
			rtnCode = getDefInfoQA();
			break;
		}
		case 'P':{
			rtnCode = getSinglePrdDefInfo();
			break;
		}
		default: {
			gszMsgBuf = "Invalide type input: [" + actionType + "]";
			return E_XPINQDEF_INVALID_INPUT;
		}
		}
		return rtnCode;
	}

	/**
	 * Only query box info
	 * 
	 * @return
	 */
	private long getPrdDefInfo() {
		long lRc = _NORMAL;	
		SimpleRtnBeen rtnBeen = new SimpleRtnBeen(_NORMAL);
		List<XpinqdefOA> oaryList = new ArrayList<XpinqdefOA>();
		String sql = "FROM Ret_wo where wo_typ='W' AND cus_id_fk='"+inTrx.getCus_id()+"'";
		if(!Util.isSpaceCheck(inTrx.getWo_id())){
			sql += " AND wo_id='" + inTrx.getWo_id() + "'";
		}
        List<Ret_wo> retWoList = retWoDao.find(sql);
        for(int i=0 ; i < retWoList.size(); i++){
    		String sql_PRD = "FROM Ret_prd_info where wo_id_fk='"+retWoList.get(i).getWo_id()
    		                 +"' AND prd_grade in (" + inTrx.getPrd_grades() + ")";
            List<Ret_prd_info> retPrdInfoList = retPrdInfoDao.find(sql_PRD);
            for(int j=0;j<retPrdInfoList.size();j++){
            	XpinqdefOA oary = new XpinqdefOA();
        		rtnBeen = queryDefCnt(retWoList.get(i),retPrdInfoList.get(j));

        		if (_NORMAL != rtnBeen.getlRc()) {
        			gszMsgBuf = rtnBeen.getMsgBuf();
        			return rtnBeen.getlRc();
        		}
        		oary = (XpinqdefOA) rtnBeen.getObj();
        		if(oary == null){
        			continue;
        		}
    			oaryList.add(oary);
            }
        }
		outTrx.setOary(oaryList);
		outTrx.setSht_cnt(oaryList.size());
		outTrx.setRtn_code(RETURN_CODE_OK);
		outTrx.setRtn_mesg(RETURN_MESG_OK);
		return lRc;
	}
	
	public SimpleRtnBeen queryDefCnt(Ret_wo ret_wo,Ret_prd_info ret_prd_info) {
		Integer wgbl_cnt = 0;
		Integer psls_cnt = 0;
		Integer fensui_cnt = 0;
		//外观不良
		ArrayList<String> ary1 = new ArrayList<String>();
		ary1.add("L001");ary1.add("L002");ary1.add("L003");ary1.add("L004");ary1.add("L005");
		ary1.add("L006");ary1.add("L007");ary1.add("L008");ary1.add("L009");ary1.add("L010");
		ary1.add("L011");ary1.add("L012");ary1.add("L013");ary1.add("L014");ary1.add("L015");
		ary1.add("L016");ary1.add("L017");ary1.add("L018");ary1.add("L052");ary1.add("L053");
		ary1.add("L054");ary1.add("L055");ary1.add("L056");ary1.add("L062");ary1.add("Z001");
		ary1.add("Z002");ary1.add("Z003");ary1.add("Z004");ary1.add("Z005");ary1.add("Z006");
		ary1.add("Z007");ary1.add("Z008");ary1.add("Z009");ary1.add("Z010");ary1.add("Z011");
		ary1.add("Z014");ary1.add("Z015");ary1.add("Z016");ary1.add("Z017");ary1.add("Z018");
		ary1.add("Z021");ary1.add("Z022");ary1.add("Z023");ary1.add("Z024");ary1.add("Z025");
		ary1.add("Z029");ary1.add("Z030");ary1.add("Z031");ary1.add("Z032");ary1.add("Z033");
		ary1.add("Z034");ary1.add("Z035");ary1.add("Z036");ary1.add("Z037");ary1.add("Z038");
		ary1.add("Z039");

		//破损+裂纹
		ArrayList<String> ary2 = new ArrayList<String>();
		ary2.add("Z004");
		ary2.add("Z005");
		//粉碎
		ArrayList<String> ary3 = new ArrayList<String>();
		ary3.add("Z007");
		
		SimpleRtnBeen rtn = new SimpleRtnBeen();
    	XpinqdefOA oary = new XpinqdefOA();
		List<Ret_prd_jge> ret_prd_jgeList = new ArrayList<Ret_prd_jge>();
		String sql = "From Ret_prd_jge WHERE id.prd_seq_id_fk = '" + ret_prd_info.getPrd_seq_id()
				+ "'  AND proc_id in (" + inTrx.getProc_ids() + ")";
		
		if (inTrx.getBegineTime() != null) {
			sql += " AND judge_timestamp >='" + inTrx.getBegineTime() + "'";
		}
		if (inTrx.getEndTime() != null) {
			sql += " AND judge_timestamp <='" + inTrx.getEndTime() + "'";
		}
		
		ret_prd_jgeList = retPrdJgeDao.find(sql);
		if(ret_prd_jgeList.isEmpty()){
			oary.setWh_in_timestamp(ret_prd_info.getWh_in_timestamp());
			oary.setCus_id(inTrx.getCus_id());
			oary.setWo_id(ret_wo.getWo_id());
			Integer model_Cnt = ret_prd_info.getX_axis_cnt_fk() * ret_prd_info.getY_axis_cnt_fk();
			oary.setModel_Cnt(model_Cnt);
			oary.setTo_thickness(ret_wo.getTo_thickness());
			oary.setMtrl_prod_id(ret_wo.getMtrl_prod_id_fk());
			oary.setMdl_id(ret_wo.getMdl_id_fk());
			oary.setFm_mdl_id(ret_wo.getFm_mdl_id_fk());
			oary.setPrd_seq_id(ret_prd_info.getPrd_seq_id());
			if(null!=ret_prd_info.getDest_shop()){
				String sql_dest ="From Bis_data where data_cate='DEST'and data_id='"+ret_prd_info.getDest_shop()+"'";
				List <Bis_data> bis_data_list_dest = bisDataDao.find(sql_dest);
				if(bis_data_list_dest.size() != 0){
					oary.setDest_shop_dsc(bis_data_list_dest.get(0).getData_desc());
				}else{
					oary.setDest_shop_dsc(ret_prd_info.getDest_shop());
				}
			}
			oary.setDest_shop(ret_prd_info.getDest_shop());
			oary.setPrd_stat(ret_prd_info.getPrd_stat());
			oary.setPrd_grade(ret_prd_info.getPrd_grade());
			oary.setBnk_flg(ret_prd_info.getBnk_flg());
			oary.setPrd_grade(ret_prd_info.getPrd_grade());
			oary.setWgbl_cnt(0);
			oary.setPsls_cnt(0);
			oary.setFensui_cnt(0);
			rtn.setObj(oary);
		}else{
			for (int i=0;i<ret_prd_jgeList.size();i++) {
				if (!Util.isSpaceCheck(ret_prd_jgeList.get(i).getDef_code1())) {
					for(int j=0;j<ary1.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(ary1.get(j))){
							wgbl_cnt = wgbl_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							break;
						}
					}
					for(int j=0;j<ary2.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(ary2.get(j))){
							psls_cnt = psls_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							break;
						}
					}
					for(int j=0;j<ary3.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(ary3.get(j))){
							fensui_cnt = fensui_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							break;
						}
					}
				} else {
					continue;
				}

				if (!Util.isSpaceCheck(ret_prd_jgeList.get(i).getDef_code2())) {
					for(int j=0;j<ary1.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code2().equals(ary1.get(j))){
							wgbl_cnt = wgbl_cnt + 1;
							break;
						}
					}
					for(int j=0;j<ary2.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code2().equals(ary2.get(j))){
							psls_cnt = psls_cnt + 1;
							break;
						}
					}
					for(int j=0;j<ary3.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code2().equals(ary3.get(j))){
							fensui_cnt = fensui_cnt + 1;
							break;
						}
					}
				} else {
					continue;
				}

				if (!Util.isSpaceCheck(ret_prd_jgeList.get(i).getDef_code3())) {
					for(int j=0;j<ary1.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code3().equals(ary1.get(j))){
							wgbl_cnt = wgbl_cnt + 1;
							break;
						}
					}
					for(int j=0;j<ary2.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code3().equals(ary2.get(j))){
							psls_cnt = psls_cnt + 1;
							break;
						}
					}
					for(int j=0;j<ary3.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code3().equals(ary3.get(j))){
							fensui_cnt = fensui_cnt + 1;
							break;
						}
					}
				} else {
					continue;
				}

				if (!Util.isSpaceCheck(ret_prd_jgeList.get(i).getDef_code4())) {
					for(int j=0;j<ary1.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code4().equals(ary1.get(j))){
							wgbl_cnt = wgbl_cnt + 1;
							break;
						}
					}
					for(int j=0;j<ary2.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code4().equals(ary2.get(j))){
							psls_cnt = psls_cnt + 1;
							break;
						}
					}
					for(int j=0;j<ary3.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code4().equals(ary3.get(j))){
							fensui_cnt = fensui_cnt + 1;
							break;
						}
					}
				} else {
					continue;
				}

				if (!Util.isSpaceCheck(ret_prd_jgeList.get(i).getDef_code5())) {
					for(int j=0;j<ary1.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code5().equals(ary1.get(j))){
							wgbl_cnt = wgbl_cnt + 1;
							break;
						}
					}
					for(int j=0;j<ary2.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code5().equals(ary2.get(j))){
							psls_cnt = psls_cnt + 1;
							break;
						}
					}
					for(int j=0;j<ary3.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code5().equals(ary3.get(j))){
							fensui_cnt = fensui_cnt + 1;
							break;
						}
					}
				}
			}
			oary.setWh_in_timestamp(ret_prd_info.getWh_in_timestamp());
			oary.setCus_id(inTrx.getCus_id());
			oary.setWo_id(ret_wo.getWo_id());
			Integer model_Cnt = ret_prd_info.getX_axis_cnt_fk() * ret_prd_info.getY_axis_cnt_fk();
			oary.setModel_Cnt(model_Cnt);
			oary.setTo_thickness(ret_wo.getTo_thickness());
			oary.setMtrl_prod_id(ret_wo.getMtrl_prod_id_fk());
			oary.setMdl_id(ret_wo.getMdl_id_fk());
			oary.setFm_mdl_id(ret_wo.getFm_mdl_id_fk());
			oary.setPrd_seq_id(ret_prd_info.getPrd_seq_id());
			if(null!=ret_prd_info.getDest_shop()){
				String sql_dest ="From Bis_data where data_cate='DEST'and data_id='"+ret_prd_info.getDest_shop()+"'";
				List <Bis_data> bis_data_list_dest = bisDataDao.find(sql_dest);
				if(bis_data_list_dest.size() != 0){
					oary.setDest_shop_dsc(bis_data_list_dest.get(0).getData_desc());
				}else{
					oary.setDest_shop_dsc(ret_prd_info.getDest_shop());
				}
			}
			oary.setDest_shop(ret_prd_info.getDest_shop());
			oary.setPrd_stat(ret_prd_info.getPrd_stat());
			oary.setPrd_grade(ret_prd_info.getPrd_grade());
			oary.setBnk_flg(ret_prd_info.getBnk_flg());
			oary.setPrd_grade(ret_prd_info.getPrd_grade());
			oary.setJudge_timestamp(ret_prd_jgeList.get(0).getJudge_timestamp());
			oary.setJudge_usr(ret_prd_jgeList.get(0).getJudge_usr());
			oary.setWgbl_cnt(wgbl_cnt);
			oary.setPsls_cnt(psls_cnt);
			oary.setFensui_cnt(fensui_cnt);
			rtn.setObj(oary);
		}	
		return rtn;
	}

	private long getSinglePrdDefInfo(){
		SimpleRtnBeen rtnBeen = new SimpleRtnBeen();
		List<Xpinqdefcsot> oaryListcsot = new ArrayList<Xpinqdefcsot>();
		String prdSeqId = inTrx.getPrd_seq_id();
		Ret_prd_info ret_prd_info = retPrdInfoDao.get(prdSeqId);
		String woIdFk = ret_prd_info.getWo_id_fk();
		Ret_wo ret_wo = retWoDao.get(woIdFk);
		String cusIdFk= ret_wo.getCus_id_fk();
		if(cusIdFk.equals("007")){
			Xpinqdefcsot oary = new Xpinqdefcsot();
			rtnBeen = getDefCntForcsot(ret_prd_info);
			if (_NORMAL != rtnBeen.getlRc()) {
				gszMsgBuf = rtnBeen.getMsgBuf();
				return rtnBeen.getlRc();
			}
			oary = (Xpinqdefcsot) rtnBeen.getObj();
			oaryListcsot.add(oary);
		}
		outTrx.setRtn_code(RETURN_CODE_OK);
		outTrx.setRtn_mesg(RETURN_MESG_OK);
		return _NORMAL;
	}
	
	private long getDefInfoQA(){
		List<XpinqdefOB> oaryList = new ArrayList<XpinqdefOB>();
		List<XpinqdefOC> oaryList2 = new ArrayList<XpinqdefOC>();
		List<Xpinqdef003> oaryList003 = new ArrayList<Xpinqdef003>();
		List<Xpinqdef063> oaryList063 = new ArrayList<Xpinqdef063>();
		List<Xpinqdef006> oaryList006 = new ArrayList<Xpinqdef006>();
		List<Xpinqdef007> oaryList007 = new ArrayList<Xpinqdef007>();
		List<Xpinqdef115> oaryList115 = new ArrayList<Xpinqdef115>();
		List<Xpinqdef008> oaryList008 = new ArrayList<Xpinqdef008>();
		List<XpinqdefHN> oaryListHN = new ArrayList<XpinqdefHN>();
		SimpleRtnBeen rtnBeen = new SimpleRtnBeen(_NORMAL);
		Ret_wo ret_so = new Ret_wo();
		//获取箱子信息
		Ret_box ret_box = new Ret_box();
		ret_box = retBoxDao.getWithLock(inTrx.getBox_id(), LockMode.UPGRADE);
		if(ret_box == null){
			gszMsgBuf = "找不到箱子[" + inTrx.getBox_id() + "]的信息！";
			return E_RET_BOX + E_READ_NOT_FOUND;
		}
		//获取工单信息
		Ret_wo ret_wo = new Ret_wo();
		ret_wo = retWoDao.getWithLock(ret_box.getWo_id_fk(), LockMode.UPGRADE);
		if(ret_wo == null){
			gszMsgBuf = "找不到内部订单[" + ret_box.getWo_id_fk() + "]的信息！";
			return E_RET_WO + E_READ_NOT_FOUND;
		}
		//获取箱子中产品信息
//		List<Ret_prd_info> retPrdInfoList = retPrdInfoDao.getShtListInfoOrderByP4Time(inTrx.getBox_id());//根据终检的开始时间排序
		List<Ret_prd_info> retPrdInfoList = retPrdInfoDao.getShtListInfoOrderBySlot(inTrx.getBox_id());//根据slot_no升序排列
		Integer prd_cnt = retPrdInfoList.size();
		if(prd_cnt > 0){
			if(!retPrdInfoList.get(0).getCr_proc_id_fk().equals(inTrx.getProc_id()) &&
					"Y".equals(inTrx.getCheck_flg())){
				gszMsgBuf = "箱子[" + inTrx.getBox_id() + "]的出货信息表只允许在["+ inTrx.getProc_id() +"]出账后打印！";
				return E_XPINQDEF_INVALID_PROC_ID;
			}
		}else{
			gszMsgBuf = "箱子[" + inTrx.getBox_id() + "]中无任何产品信息！";
			return E_RET_PRD_INFO + E_READ_NOT_FOUND;
		}
		if(ret_wo.getCus_id_fk().equals("003")){//003客户
			 for(int j=0;j<prd_cnt;j++){
	        	Xpinqdef003 oary003 = new Xpinqdef003();
	        	rtnBeen = getDefCntFor003(retPrdInfoList.get(j));

	    		if (_NORMAL != rtnBeen.getlRc()) {
	    			gszMsgBuf = rtnBeen.getMsgBuf();
	    			return rtnBeen.getlRc();
	    		}
	    		oary003 = (Xpinqdef003) rtnBeen.getObj();
	    		oaryList003.add(oary003);
	        }
		}else if(ret_wo.getCus_id_fk().equals("006")){//006厦门天马客户，镀膜和减薄的统计方式不一样
//			if(inTrx.getProc_id().equals("JBQA")){
//				//获取商务订单的信息
//				ret_so = retWoDao.getWithLock(ret_wo.getSo_id(), LockMode.UPGRADE);
//				if(ret_so == null){
//					gszMsgBuf = "找不到商务订单[" + ret_wo.getSo_id() + "]的信息！";
//					return E_RET_WO + E_READ_NOT_FOUND;
//				}
//				if(!"DQR".equals(ret_wo.getSo_id().substring(0, 3))){
//					outTrx.setAct_so_id(ret_so.getSo_id());
//				}
//				for(int j=0;j<prd_cnt;j++){
//		        	Xpinqdef006 oary006 = new Xpinqdef006();
//		        	rtnBeen = getDefCntFor006JBQA(retPrdInfoList.get(j));
//
//		    		if (_NORMAL != rtnBeen.getlRc()) {
//		    			gszMsgBuf = rtnBeen.getMsgBuf();
//		    			return rtnBeen.getlRc();
//		    		}
//		    		oary006 = (Xpinqdef006) rtnBeen.getObj();
//		    		oaryList006.add(oary006);
//		        }
//			}else if(inTrx.getProc_id().equals("DMQA")){//镀膜统计方式和028,071,088客户一致
				 for(int j=0;j<prd_cnt;j++){
		        	XpinqdefOC oaryC = new XpinqdefOC();
		        	rtnBeen = getDefCntFor006DMQA(retPrdInfoList.get(j));

		    		if (_NORMAL != rtnBeen.getlRc()) {
		    			gszMsgBuf = rtnBeen.getMsgBuf();
		    			return rtnBeen.getlRc();
		    		}
		    		oaryC = (XpinqdefOC) rtnBeen.getObj();
		    		oaryList2.add(oaryC);
		        }
//			}
		}else  if(ret_wo.getCus_id_fk().equals("007")){
			for(int j=0;j<prd_cnt;j++){
				Xpinqdef007 oary007 = new Xpinqdef007();   // 结果
				rtnBeen=getDefCntForHX(retPrdInfoList.get(j));
				if (_NORMAL != rtnBeen.getlRc()) {
					gszMsgBuf = rtnBeen.getMsgBuf();
					return rtnBeen.getlRc();
				}
				oary007 = (Xpinqdef007) rtnBeen.getObj();
				oaryList007.add(oary007);
			}

		}else if(ret_wo.getCus_id_fk().equals("008")){//008客户
			for(int j=0;j<prd_cnt;j++){
	        	Xpinqdef008 oary008 = new Xpinqdef008();
	        	rtnBeen = getDefCntFor008(retPrdInfoList.get(j));

	    		if (_NORMAL != rtnBeen.getlRc()) {
	    			gszMsgBuf = rtnBeen.getMsgBuf();
	    			return rtnBeen.getlRc();
	    		}
	    		oary008 = (Xpinqdef008) rtnBeen.getObj();
				oaryList008.add(oary008);
	        }
		}else if(ret_wo.getCus_id_fk().equals("063")){//063客户
			 for(int j=0;j<prd_cnt;j++){
	        	Xpinqdef063 oary063 = new Xpinqdef063();
	        	rtnBeen = getDefCntFor063(retPrdInfoList.get(j));

	    		if (_NORMAL != rtnBeen.getlRc()) {
	    			gszMsgBuf = rtnBeen.getMsgBuf();
	    			return rtnBeen.getlRc();
	    		}
	    		oary063 = (Xpinqdef063) rtnBeen.getObj();
	    		oaryList063.add(oary063);
	        }
		}else if(ret_wo.getCus_id_fk().equals("028") ||
			ret_wo.getCus_id_fk().equals("071") ||
			ret_wo.getCus_id_fk().equals("088")){ //028,071,088
			 for(int j=0;j<prd_cnt;j++){
	        	XpinqdefOC oaryC = new XpinqdefOC();
	        	rtnBeen = getDefCntForTM(ret_wo.getWo_cate(),retPrdInfoList.get(j));

	    		if (_NORMAL != rtnBeen.getlRc()) {
	    			gszMsgBuf = rtnBeen.getMsgBuf();
	    			return rtnBeen.getlRc();
	    		}
	    		oaryC = (XpinqdefOC) rtnBeen.getObj();
	    		oaryList2.add(oaryC);
	        }
		}else if(ret_wo.getCus_id_fk().equals("098")){//098客户，镀膜和减薄的统计方式不一样
			if(inTrx.getProc_id().equals("JBQA")){
				 for(int j=0;j<prd_cnt;j++){
		        	Xpinqdef006 oary006 = new Xpinqdef006();
		        	rtnBeen = getDefCntFor098JBQA(retPrdInfoList.get(j));

		    		if (_NORMAL != rtnBeen.getlRc()) {
		    			gszMsgBuf = rtnBeen.getMsgBuf();
		    			return rtnBeen.getlRc();
		    		}
		    		oary006 = (Xpinqdef006) rtnBeen.getObj();
		    		oaryList006.add(oary006);
		        }
			}else if(inTrx.getProc_id().equals("DMQA")){
				 for(int j=0;j<prd_cnt;j++){
		        	XpinqdefOC oaryC = new XpinqdefOC();
		        	rtnBeen = getDefCntFor098DMQA(retPrdInfoList.get(j));

		    		if (_NORMAL != rtnBeen.getlRc()) {
		    			gszMsgBuf = rtnBeen.getMsgBuf();
		    			return rtnBeen.getlRc();
		    		}
		    		oaryC = (XpinqdefOC) rtnBeen.getObj();
		    		oaryList2.add(oaryC);
		        }
			}
		}else if(ret_wo.getCus_id_fk().equals("115")){//115客户
			for(int j=0;j<prd_cnt;j++){
	        	Xpinqdef115 oary115 = new Xpinqdef115();
	        	rtnBeen = getDefCntFor115(retPrdInfoList.get(j));

	    		if (_NORMAL != rtnBeen.getlRc()) {
	    			gszMsgBuf = rtnBeen.getMsgBuf();
	    			return rtnBeen.getlRc();
	    		}
	    		oary115 = (Xpinqdef115) rtnBeen.getObj();
				oaryList115.add(oary115);
	        }
		}else{ //华南客户
			 for(int j=0;j<prd_cnt;j++){
		        XpinqdefHN oaryHN = new XpinqdefHN();
		        rtnBeen = getDefCntForHN(retPrdInfoList.get(j));
	
		    	if (_NORMAL != rtnBeen.getlRc()) {
		    		gszMsgBuf = rtnBeen.getMsgBuf();
		    		return rtnBeen.getlRc();
		    	}
		    	oaryHN = (XpinqdefHN) rtnBeen.getObj();
		    	oaryListHN.add(oaryHN);
	        }
		}
       
		//获取商务订单的信息
		ret_so = retWoDao.getWithLock(ret_wo.getSo_id(), LockMode.UPGRADE);
		if(ret_so == null){
			gszMsgBuf = "找不到商务订单[" + ret_wo.getSo_id() + "]的信息！";
			return E_RET_WO + E_READ_NOT_FOUND;
		}
		if(!"DQR".equals(ret_so.getSo_id().substring(0, 3))){
			outTrx.setAct_so_id(ret_so.getSo_id());
		}
		if(!ret_wo.getMdl_id_fk().isEmpty()){
			Bis_mdl_def bis_mdl_def =bisMdlDefDao.get(ret_wo.getMdl_id_fk());
			outTrx.setMdl_typ(bis_mdl_def.getMdl_typ());
			outTrx.setMdl_typ(bis_mdl_def.getMdl_typ());
		}
        outTrx.setCus_id(ret_wo.getCus_id_fk());
        outTrx.setBox_id(inTrx.getBox_id());
		outTrx.setPrd_cnt(prd_cnt);
        outTrx.setWo_id(ret_wo.getWo_id());
        outTrx.setMdl_id_fk(ret_wo.getMdl_id_fk());
        outTrx.setFm_mdl_id_fk(ret_wo.getFm_mdl_id_fk());
        outTrx.setOpe_eff_flg(ret_wo.getOpe_eff_flg());
        outTrx.setShip_box_id(ret_box.getShip_box_id());

        /*if(ret_wo.getOpe_eff_flg().equals("Y") && ("006".equals(ret_wo.getCus_id_fk()) ||
        		"028".equals(ret_wo.getCus_id_fk()) ||
        		"071".equals(ret_wo.getCus_id_fk()) ||
        		"088".equals(ret_wo.getCus_id_fk()))){ //原箱打印
        	outTrx.setStd_qty(Integer.parseInt(maxSlotNo));
        }else{//非原箱打印*/
        	outTrx.setStd_qty(prd_cnt);
//        }
        if(ret_wo.getCus_info_fst() == null){
        	outTrx.setCus_info_fst(_SPACE0);
        }else{
            outTrx.setCus_info_fst(ret_wo.getCus_info_fst());
        }
        if(prd_cnt != 0 && modelCnt != 0){
        	double proc_yield_1 = (1 - p_def_cnt/prd_cnt/modelCnt) * 100;
    		BigDecimal   p   =   new   BigDecimal(proc_yield_1);  
    		proc_yield   =   p.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
    		if(ret_wo.getCus_id_fk().equals("003") ||
    				ret_wo.getCus_id_fk().equals("006") ||
    				ret_wo.getCus_id_fk().equals("008") ||
    				ret_wo.getCus_id_fk().equals("063") ||
    				ret_wo.getCus_id_fk().equals("028") ||
    				ret_wo.getCus_id_fk().equals("071") ||
    				ret_wo.getCus_id_fk().equals("088") ||
    				ret_wo.getCus_id_fk().equals("098") ||
    				ret_wo.getCus_id_fk().equals("115")){
        		double whole_yield_1 = (1 - (l_def_cnt+p_def_cnt)/prd_cnt/modelCnt) * 100;
        		BigDecimal w = new BigDecimal(whole_yield_1);  
        		whole_yield = w.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); 
    		}else  if(ret_wo.getCus_id_fk().equals("007") ){
				double whole_yield_1 = (1 - (p_def_cnt)/prd_cnt/modelCnt) * 100;
				BigDecimal w = new BigDecimal(whole_yield_1);
				whole_yield = w.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
			}else{
        		double whole_yield_1 = (1 - (p_def_cnt+d_def_cnt)/prd_cnt/modelCnt) * 100;
        		BigDecimal w = new BigDecimal(whole_yield_1);  
        		whole_yield = w.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); 
    		}
        }else{
        	proc_yield = 100.0;
        	whole_yield = 100.0;
        }
		
		outTrx.setL_def_cnt(l_def_cnt);//来料不良
		outTrx.setD_def_cnt(d_def_cnt);//待确认不良，只有华南客户出货信息表才会有值，其他客户均为0
		outTrx.setP_def_cnt(p_def_cnt);//制程不良
		outTrx.setProc_yield(proc_yield);//制程良率
		outTrx.setWhole_yield(whole_yield);//总良率
		outTrx.setG_yjyc_cnt(g_yjyc_cnt);//液晶异常
		outTrx.setOaryB(oaryList);
		outTrx.setOaryC(oaryList2);
		outTrx.setOary003(oaryList003);
		outTrx.setOary063(oaryList063);
		outTrx.setOary006(oaryList006);
		outTrx.setOary007(oaryList007);
		outTrx.setOary115(oaryList115);
		outTrx.setOary008(oaryList008);
		outTrx.setOaryHN(oaryListHN);
		outTrx.setSo_id(ret_wo.getSo_id());
		outTrx.setMtrl_prod_id_fk(ret_wo.getMtrl_prod_id_fk());
        if(ret_box.getExt_1() == null){
        	outTrx.setCheck_user(_SPACE0);
        }else{
            outTrx.setCheck_user(ret_box.getExt_1());
        }
		outTrx.setRtn_code(RETURN_CODE_OK);
		outTrx.setRtn_mesg(RETURN_MESG_OK);
		return _NORMAL;
	}

	public SimpleRtnBeen getDefCntForcsot(Ret_prd_info ret_prd_info){
		SimpleRtnBeen rtn = new SimpleRtnBeen();

		return rtn;
	}

	/**
	 * for 003
	 * @param ret_prd_info
	 * @return
	 */
	public SimpleRtnBeen getDefCntFor003(Ret_prd_info ret_prd_info) {
		Integer r_yjyc_cnt = 0;     
		Integer r_llhx_cnt = 0;     
		Integer r_atd_cnt = 0;      
		Integer r_pl_cnt = 0;       
		Integer r_lh_cnt = 0;       
		Integer r_qj_cnt = 0;       
		Integer r_hs_cnt = 0;       
		Integer r_bw_cnt = 0;       
		Integer r_other = 0;        
		Integer c_pl_cnt = 0;       
		Integer c_lh_cnt = 0;       
		Integer c_qj_cnt = 0;       
		Integer c_cj_cnt = 0;       
		Integer c_ly_cnt = 0;       
		Integer c_lsw_cnt = 0;      
		Integer c_td_cnt = 0;       
		Integer c_lhy_cnt = 0;      
		Integer c_ad_cnt = 0;       
		Integer c_hs_cnt = 0;       
		Integer c_bw_cnt = 0;       
		Integer c_other = 0; 
		/**
		 * 入料检验
		 */
		//液晶异常
		ArrayList<String> lAry1 = new ArrayList<String>();
		//来料划X
		ArrayList<String> lAry2 = new ArrayList<String>();
		//凹凸点
		ArrayList<String> lAry3 = new ArrayList<String>();
		//破裂
		ArrayList<String> lAry4 = new ArrayList<String>();
		//裂痕
		ArrayList<String> lAry5 = new ArrayList<String>();
		//缺角
		ArrayList<String> lAry6 = new ArrayList<String>();
		//划伤
		ArrayList<String> lAry7 = new ArrayList<String>();
		//表污
		ArrayList<String> lAry8 = new ArrayList<String>();
		/**
		 * 出货检验
		 */
		//破裂
		ArrayList<String> cAry1 = new ArrayList<String>();
		//裂痕
		ArrayList<String> cAry2 = new ArrayList<String>();
		//缺角
		ArrayList<String> cAry3 = new ArrayList<String>();
		//残胶
		ArrayList<String> cAry4 = new ArrayList<String>();
		//漏液
		ArrayList<String> cAry5 = new ArrayList<String>();
		//流水纹
		ArrayList<String> cAry6 = new ArrayList<String>();
		//凸点
		ArrayList<String> cAry7 = new ArrayList<String>();
		//轮痕
		ArrayList<String> cAry8 = new ArrayList<String>();
		//凸点
		ArrayList<String> cAry9 = new ArrayList<String>();
		//划伤
		ArrayList<String> cAry10 = new ArrayList<String>();
		//表污
		ArrayList<String> cAry11 = new ArrayList<String>();

		if(inTrx.getProc_id().equals("JBQA")){//减薄QA
			lAry1.add("L001");lAry1.add("L013");lAry1.add("L018");lAry1.add("L051");lAry1.add("L052");
			lAry2.add("L014");lAry2.add("L015");
			lAry3.add("L004");lAry3.add("L009");lAry3.add("L010");lAry3.add("L053");
			lAry4.add("L002");lAry4.add("L005");
			lAry7.add("L003");
			lAry8.add("L007");
			cAry1.add("Z004");cAry1.add("Z007");
			cAry2.add("Z005");
			cAry5.add("Z006");cAry5.add("Z009");cAry5.add("Z010");
			cAry6.add("Z011");cAry6.add("Z014");cAry6.add("Z015");
			cAry9.add("Z002");cAry9.add("Z003");cAry9.add("Z039");
			cAry10.add("Z001");
			cAry11.add("Z008");
		}else{//镀膜QA
			lAry1.add("L001");lAry1.add("L013");lAry1.add("L018");lAry1.add("L052");
			lAry2.add("L014");lAry2.add("L015");
			lAry3.add("L004");lAry3.add("L009");lAry3.add("L010");lAry3.add("L053");
			lAry4.add("L002");lAry4.add("L005");
			lAry7.add("L003");
			lAry8.add("L007");
			cAry1.add("Z004");cAry1.add("Z005");cAry1.add("Z007");
			cAry5.add("Z009");cAry5.add("Z010");
			cAry6.add("Z011");cAry6.add("Z015");
			cAry9.add("Z002");cAry9.add("Z039");
			cAry10.add("Z001");
			cAry11.add("Z008");
		}
		
		SimpleRtnBeen rtn = new SimpleRtnBeen();
		Xpinqdef003 oary003 = new Xpinqdef003();
		List<Ret_prd_jge> ret_prd_jgeList = new ArrayList<Ret_prd_jge>();
		String sql = "From Ret_prd_jge WHERE id.prd_seq_id_fk = '" + ret_prd_info.getPrd_seq_id()  + "' AND lst_judge_flg='Y' AND proc_id<>'JBYZ'";
		ret_prd_jgeList = retPrdJgeDao.find(sql);
		for (int i=0;i<ret_prd_jgeList.size();i++) {
			String other_flg_1 = "N";
			if (!Util.isSpaceCheck(ret_prd_jgeList.get(i).getDef_code1())) {
				if(other_flg_1.equals("N")){
					for(int j=0;j<lAry1.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(lAry1.get(j))){
							r_yjyc_cnt = r_yjyc_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<lAry2.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(lAry2.get(j))){
							r_llhx_cnt = r_llhx_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}
//				if(other_flg_1.equals("N")){
//					for(int j=0;j<lAry3.size();j++){
//						if(ret_prd_jgeList.get(i).getDef_code1().equals(lAry3.get(j))){
//							r_atd_cnt = r_atd_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
//							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
//								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
//							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
//								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
//							}
//							other_flg_1 = "Y";
//							break;
//						}
//					}
//				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<lAry4.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(lAry4.get(j))){
							r_pl_cnt = r_pl_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<lAry5.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(lAry5.get(j))){
							r_lh_cnt = r_lh_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<lAry6.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(lAry6.get(j))){
							r_qj_cnt = r_qj_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}
//				if(other_flg_1.equals("N")){
//					for(int j=0;j<lAry7.size();j++){
//						if(ret_prd_jgeList.get(i).getDef_code1().equals(lAry7.get(j))){
//							r_hs_cnt = r_hs_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
//							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
//								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
//							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
//								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
//							}
//							other_flg_1 = "Y";
//							break;
//						}
//					}
//				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<lAry8.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(lAry8.get(j))){
							r_bw_cnt = r_bw_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<cAry1.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(cAry1.get(j))){
							c_pl_cnt = c_pl_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<cAry2.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(cAry2.get(j))){
							c_lh_cnt = c_lh_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<cAry3.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(cAry3.get(j))){
							c_qj_cnt = c_qj_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<cAry4.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(cAry4.get(j))){
							c_cj_cnt = c_cj_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<cAry5.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(cAry5.get(j))){
							c_ly_cnt = c_ly_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<cAry6.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(cAry6.get(j))){
							c_lsw_cnt = c_lsw_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<cAry7.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(cAry7.get(j))){
							c_td_cnt = c_td_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<cAry8.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(cAry8.get(j))){
							c_lhy_cnt = c_lhy_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}
//				if(other_flg_1.equals("N")){
//					for(int j=0;j<cAry9.size();j++){
//						if(ret_prd_jgeList.get(i).getDef_code1().equals(cAry9.get(j))){
//							c_ad_cnt = c_ad_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
//							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
//								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
//							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
//								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
//							}
//							other_flg_1 = "Y";
//							break;
//						}
//					}
//				}
//				if(other_flg_1.equals("N")){
//					for(int j=0;j<cAry10.size();j++){
//						if(ret_prd_jgeList.get(i).getDef_code1().equals(cAry10.get(j))){
//							c_hs_cnt = c_hs_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
//							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
//								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
//							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
//								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
//							}
//							other_flg_1 = "Y";
//							break;
//						}
//					}
//				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<cAry11.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(cAry11.get(j))){
							c_bw_cnt = c_bw_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}
//				if(other_flg_1.equals("N")){
//					if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
//						r_other = r_other + ret_prd_jgeList.get(i).getDef_code1_cnt();
//						l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
//					}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
//						c_other = c_other + ret_prd_jgeList.get(i).getDef_code1_cnt();
//						p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
//					}
//				}
			}
		}
		
		
		/**
		 * 获取最大slot_no
		 */
		if(Integer.parseInt(maxSlotNo) < Integer.parseInt(ret_prd_info.getSlot_no())){
			maxSlotNo = ret_prd_info.getSlot_no();
		}
		
		oary003.setPrd_seq_id(ret_prd_info.getPrd_seq_id());
		oary003.setFab_sn(ret_prd_info.getFab_sn());
		oary003.setMtrl_box_id_fk(ret_prd_info.getMtrl_box_id_fk());
		oary003.setSlot_no(ret_prd_info.getSlot_no());
		oary003.setPrd_grade(ret_prd_info.getPrd_grade());
		oary003.setR_yjyc_cnt(r_yjyc_cnt);
		oary003.setR_llhx_cnt(r_llhx_cnt);
		oary003.setR_atd_cnt(r_atd_cnt);
		oary003.setR_pl_cnt(r_pl_cnt);
		oary003.setR_lh_cnt(r_lh_cnt);
		oary003.setR_qj_cnt(r_qj_cnt);
		oary003.setR_hs_cnt(r_hs_cnt);
		oary003.setR_bw_cnt(r_bw_cnt);
		oary003.setR_other(r_other);
		oary003.setC_pl_cnt(c_pl_cnt);
		oary003.setC_lh_cnt(c_lh_cnt);
		oary003.setC_qj_cnt(c_qj_cnt);
		oary003.setC_cj_cnt(c_cj_cnt);
		oary003.setC_ly_cnt(c_ly_cnt);
		oary003.setC_lsw_cnt(c_lsw_cnt);
		oary003.setC_td_cnt(c_td_cnt);
		oary003.setC_lhy_cnt(c_lhy_cnt);
		oary003.setC_ad_cnt(c_ad_cnt);
		oary003.setC_hs_cnt(c_hs_cnt);
		oary003.setC_bw_cnt(c_bw_cnt);
		oary003.setC_other(c_other);
		if(ret_prd_info.getDs_recipe_id() == null){
			oary003.setRemark(_SPACE0);
		}else{
			oary003.setRemark(ret_prd_info.getDs_recipe_id());
		}
		rtn.setObj(oary003);
		outTrx.setDn_no(ret_prd_info.getDn_no());
		modelCnt = ret_prd_info.getX_axis_cnt_fk() * ret_prd_info.getY_axis_cnt_fk();
		outTrx.setModel_cnt(modelCnt);
		return rtn;
	}

	/**
	 * for 006JBQA
	 * @param ret_prd_info
	 * @return
	 */
	public SimpleRtnBeen getDefCntFor006JBQA(Ret_prd_info ret_prd_info) {
		Integer C_z_pl_cnt = 0;  
		Integer C_z_ly_cnt = 0;  
		Integer C_z_zw_cnt = 0;  
		Integer C_z_skbj_cnt = 0;
		Integer C_z_atd_cnt = 0; 
		Integer C_z_hs_cnt = 0;  
		Integer C_l_pl_cnt = 0;  
		Integer C_l_yjyc_cnt = 0;
		Integer C_l_ad_cnt = 0;  
		Integer C_l_mjad_cnt = 0;
		Integer C_l_hs_cnt = 0;  
		Integer C_l_gly_cnt = 0; 
		Integer T_z_zw_cnt = 0;  
		Integer T_z_skbj_cnt = 0;
		Integer T_z_atd_cnt = 0; 
		Integer T_z_hs_cnt = 0;  
		Integer T_l_ad_cnt = 0;  
		Integer T_l_mjad_cnt = 0;
		Integer T_l_hs_cnt = 0;  
		Integer T_l_gly_cnt = 0; 
		/**
		 * CF面制程
		 */
		//破裂
		ArrayList<String> C_z_Ary1 = new ArrayList<String>();
		C_z_Ary1.add("Z004");C_z_Ary1.add("Z005");
		//漏液
		ArrayList<String> C_z_Ary2 = new ArrayList<String>();
		C_z_Ary2.add("Z009");C_z_Ary2.add("Z010");C_z_Ary2.add("Z006");
		//脏污
		ArrayList<String> C_z_Ary3 = new ArrayList<String>();
		C_z_Ary3.add("Z008");
		//蚀刻不均
		ArrayList<String> C_z_Ary4 = new ArrayList<String>();
		C_z_Ary4.add("Z011");C_z_Ary4.add("Z015");C_z_Ary4.add("Z014");
		//凹凸点
		ArrayList<String> C_z_Ary5 = new ArrayList<String>();
		C_z_Ary5.add("Z039");C_z_Ary5.add("Z002");
		//划伤
		ArrayList<String> C_z_Ary6 = new ArrayList<String>();
		C_z_Ary6.add("Z001");
		/**
		 * CF面来料不良
		 */
		//破裂
		ArrayList<String> C_l_Ary1 = new ArrayList<String>();
		C_l_Ary1.add("L002");C_l_Ary1.add("L005");
		//液晶异常
		ArrayList<String> C_l_Ary2 = new ArrayList<String>();
		C_l_Ary2.add("L001");C_l_Ary2.add("L018");C_l_Ary2.add("L052");
		C_l_Ary2.add("L013");C_l_Ary2.add("L014");C_l_Ary2.add("L015");
		C_l_Ary2.add("L051");
		//凹点
		ArrayList<String> C_l_Ary3 = new ArrayList<String>();
		C_l_Ary3.add("L053");
		//密集凹点
		ArrayList<String> C_l_Ary4 = new ArrayList<String>();
		C_l_Ary4.add("L009");C_l_Ary4.add("L010");
		//划伤
		ArrayList<String> C_l_Ary5 = new ArrayList<String>();
		C_l_Ary5.add("L003");
		//滚轮印
		ArrayList<String> C_l_Ary6 = new ArrayList<String>();
		C_l_Ary6.add("L004");
		/**
		 * TFT面制程
		 */
		//脏污
		ArrayList<String> T_z_Ary1 = new ArrayList<String>();
		T_z_Ary1.add("Z008");
		//蚀刻不均
		ArrayList<String> T_z_Ary2 = new ArrayList<String>();
		T_z_Ary2.add("Z011");T_z_Ary2.add("Z015");T_z_Ary2.add("Z014");
		//凸点
		ArrayList<String> T_z_Ary3 = new ArrayList<String>();
		T_z_Ary3.add("Z039");T_z_Ary3.add("Z002");
		//划伤
		ArrayList<String> T_z_Ary4 = new ArrayList<String>();
		T_z_Ary4.add("Z001");
		/**
		 * TFT面来料不良 
		 */
		//凹点
		ArrayList<String> T_l_Ary1 = new ArrayList<String>();
		T_l_Ary1.add("L008");
		//密集凹点
		ArrayList<String> T_l_Ary2 = new ArrayList<String>();
		T_l_Ary2.add("L009");T_l_Ary2.add("L010");
		//划伤
		ArrayList<String> T_l_Ary3 = new ArrayList<String>();
		T_l_Ary3.add("L003");
		//滚轮印
		ArrayList<String> T_l_Ary4 = new ArrayList<String>();
		T_l_Ary4.add("L004");
		
		SimpleRtnBeen rtn = new SimpleRtnBeen();
    	Xpinqdef006 oary006 = new Xpinqdef006();
		List<Ret_prd_jge> ret_prd_jgeList = new ArrayList<Ret_prd_jge>();
		String sql = "From Ret_prd_jge WHERE id.prd_seq_id_fk = '" + ret_prd_info.getPrd_seq_id()  + "' AND lst_judge_flg='Y' AND proc_id<>'JBYZ'";
		
		ret_prd_jgeList = retPrdJgeDao.find(sql);
		for (int i=0;i<ret_prd_jgeList.size();i++) {
			String other_flg_1 = "N";
			if (!Util.isSpaceCheck(ret_prd_jgeList.get(i).getDef_code1())) {
				if(other_flg_1.equals("N")){//CF面制程破裂
					for(int j=0;j<C_z_Ary1.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(C_z_Ary1.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							C_z_pl_cnt = C_z_pl_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//CF面制程漏液
					for(int j=0;j<C_z_Ary2.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(C_z_Ary2.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							C_z_ly_cnt = C_z_ly_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//CF面制程脏污
					for(int j=0;j<C_z_Ary3.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(C_z_Ary3.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							C_z_zw_cnt = C_z_zw_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//CF面制程蚀刻不均
					for(int j=0;j<C_z_Ary4.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(C_z_Ary4.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							C_z_skbj_cnt = C_z_skbj_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//CF面制程凹凸点
					for(int j=0;j<C_z_Ary5.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(C_z_Ary5.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							C_z_atd_cnt = C_z_atd_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//CF面制程划伤
					for(int j=0;j<C_z_Ary6.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(C_z_Ary6.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							C_z_hs_cnt = C_z_hs_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//CF面来料不良破裂
					for(int j=0;j<C_l_Ary1.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(C_l_Ary1.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							C_l_pl_cnt = C_l_pl_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//CF面来料不良液晶异常
					for(int j=0;j<C_l_Ary2.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(C_l_Ary2.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							C_l_yjyc_cnt = C_l_yjyc_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//CF面来料不良凹点 
					for(int j=0;j<C_l_Ary3.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(C_l_Ary3.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							C_l_ad_cnt = C_l_ad_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}

				if(other_flg_1.equals("N")){//CF面来料不良密集凹点
					for(int j=0;j<C_l_Ary4.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(C_l_Ary4.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							C_l_mjad_cnt = C_l_mjad_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//CF面来料不良划伤 
					for(int j=0;j<C_l_Ary5.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(C_l_Ary5.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							C_l_hs_cnt = C_l_hs_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}

				if(other_flg_1.equals("N")){//CF面来料不良滚轮印
					for(int j=0;j<C_l_Ary6.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(C_l_Ary6.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							C_l_gly_cnt = C_l_gly_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//TFT面制程脏污
					for(int j=0;j<T_z_Ary1.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(T_z_Ary1.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
							T_z_zw_cnt = T_z_zw_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//TFT面制程蚀刻不均
					for(int j=0;j<T_z_Ary2.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(T_z_Ary2.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
							T_z_skbj_cnt = T_z_skbj_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//TFT面制程凸点
					for(int j=0;j<T_z_Ary3.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(T_z_Ary3.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
							T_z_atd_cnt = T_z_atd_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//TFT面制程划伤
					for(int j=0;j<T_z_Ary4.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(T_z_Ary4.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
							T_z_hs_cnt = T_z_hs_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//TFT面来料不良凹点
					for(int j=0;j<T_l_Ary1.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(T_l_Ary1.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
							T_l_ad_cnt = T_l_ad_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//TFT面来料不良密集凹点
					for(int j=0;j<T_l_Ary2.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(T_l_Ary2.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
							T_l_mjad_cnt = T_l_mjad_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//TFT面来料不良划伤
					for(int j=0;j<T_l_Ary3.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(T_l_Ary3.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
							T_l_hs_cnt = T_l_hs_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//TFT面来料不良滚轮印
					for(int j=0;j<T_l_Ary4.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(T_l_Ary4.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
							T_l_gly_cnt = T_l_gly_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
			}
		}
		
		/**
		 * 获取最大slot_no
		 */
		if(Integer.parseInt(maxSlotNo) < Integer.parseInt(ret_prd_info.getMtrl_slot_no_fk())){
			maxSlotNo = ret_prd_info.getMtrl_slot_no_fk();
		}
		
		oary006.setPrd_seq_id(ret_prd_info.getPrd_seq_id());
		oary006.setFab_sn(ret_prd_info.getFab_sn());
		oary006.setSlot_no(ret_prd_info.getMtrl_slot_no_fk());
		oary006.setMtrl_box_id_fk(ret_prd_info.getMtrl_box_id_fk());
		oary006.setPrd_grade(ret_prd_info.getPrd_grade());
		oary006.setC_z_pl_cnt(C_z_pl_cnt);
		oary006.setC_z_ly_cnt(C_z_ly_cnt);
		oary006.setC_z_zw_cnt(C_z_zw_cnt);
		oary006.setC_z_skbj_cnt(C_z_skbj_cnt);
		oary006.setC_z_atd_cnt(C_z_atd_cnt);
		oary006.setC_z_hs_cnt(C_z_hs_cnt);
		oary006.setC_l_pl_cnt(C_l_pl_cnt);
		oary006.setC_l_yjyc_cnt(C_l_yjyc_cnt);
		oary006.setC_l_ad_cnt(C_l_ad_cnt);
		oary006.setC_l_mjad_cnt(C_l_mjad_cnt);
		oary006.setC_l_hs_cnt(C_l_hs_cnt);
		oary006.setC_l_gly_cnt(C_l_gly_cnt);
		oary006.setT_z_zw_cnt(T_z_zw_cnt);
		oary006.setT_z_skbj_cnt(T_z_skbj_cnt);
		oary006.setT_z_atd_cnt(T_z_atd_cnt);
		oary006.setT_z_hs_cnt(T_z_hs_cnt);
		oary006.setT_l_ad_cnt(T_l_ad_cnt);
		oary006.setT_l_mjad_cnt(T_l_mjad_cnt);
		oary006.setT_l_hs_cnt(T_l_hs_cnt);
		oary006.setT_l_gly_cnt(T_l_gly_cnt);
		
		if(ret_prd_info.getDs_recipe_id() == null){
			oary006.setRemark(_SPACE0);
		}else{
			oary006.setRemark(ret_prd_info.getDs_recipe_id());
		}
		rtn.setObj(oary006);
		outTrx.setDn_no(ret_prd_info.getDn_no());
		modelCnt = ret_prd_info.getX_axis_cnt_fk() * ret_prd_info.getY_axis_cnt_fk();
		outTrx.setModel_cnt(modelCnt);
		return rtn;
	}


	/**
	 * 007
	 * @param ret_prd_info
	 * @return
	 */
	public SimpleRtnBeen getDefCntFor006DMQA(Ret_prd_info ret_prd_info) {
		Integer yjyc_cnt = 0;
		Integer sy_cnt = 0;
		Integer C_hs_cnt = 0;
		Integer C_ad_cnt = 0;
		Integer C_td_cnt = 0;
		Integer C_shbj_cnt = 0;
		Integer C_ps_cnt = 0;
		Integer C_zw_cnt = 0;
		Integer C_ly_cnt = 0;
		Integer C_other = 0;
		Integer T_hs_cnt = 0;
		Integer T_ad_cnt = 0;
		Integer T_td_cnt = 0;
		Integer T_shbj_cnt = 0;
		Integer T_ps_cnt = 0;
		Integer T_zw_cnt = 0;
		Integer T_ly_cnt = 0;
		Integer T_other = 0;
		//液晶异常
		ArrayList<String> Ary1 = new ArrayList<String>();
		//渗液
		ArrayList<String> Ary2 = new ArrayList<String>();
		//划伤
		ArrayList<String> Ary3 = new ArrayList<String>();
		//凹点
		ArrayList<String> Ary4 = new ArrayList<String>();
		//凸点
		ArrayList<String> Ary5 = new ArrayList<String>();
		//酸蚀不均
		ArrayList<String> Ary6 = new ArrayList<String>();
		//破损
		ArrayList<String> Ary7 = new ArrayList<String>();
		//脏污
		ArrayList<String> Ary8 = new ArrayList<String>();
		//轮印
		ArrayList<String> Ary9 = new ArrayList<String>();
		
		Ary1.add("L001");Ary1.add("L018");Ary1.add("L052");
		Ary1.add("L013");Ary1.add("L014");Ary1.add("L015");
		Ary1.add("I2");Ary1.add("I1");
		Ary2.add("Z009");Ary2.add("Z010");
		Ary2.add("F");
		Ary3.add("L003");Ary3.add("Z001");
		Ary3.add("R1");Ary3.add("R2");
		Ary4.add("L008");Ary4.add("L009");Ary4.add("L010");
		Ary4.add("L053");Ary4.add("Z002");Ary4.add("Z003");
		Ary4.add("D");
		Ary5.add("Z039");
		Ary5.add("A1");
		Ary6.add("Z011");Ary6.add("Z015");
		Ary6.add("H1");
		Ary7.add("L002");Ary7.add("L005");Ary7.add("Z004");
		Ary7.add("Z005");Ary7.add("Z007");
		Ary7.add("B1");Ary7.add("B2");
		Ary8.add("Z008");Ary8.add("T");
		Ary9.add("L004");Ary9.add("L");

		SimpleRtnBeen rtn = new SimpleRtnBeen();
    	XpinqdefOC oary = new XpinqdefOC();
		List<Ret_prd_jge> ret_prd_jgeList = new ArrayList<Ret_prd_jge>();
		String sql = "From Ret_prd_jge WHERE id.prd_seq_id_fk = '" + ret_prd_info.getPrd_seq_id()  + "' AND lst_judge_flg='Y' AND proc_id<>'JBYZ'";
		
		ret_prd_jgeList = retPrdJgeDao.find(sql);
		for (int i=0;i<ret_prd_jgeList.size();i++) {
			String other_flg_1 = "N";
			if (!Util.isSpaceCheck(ret_prd_jgeList.get(i).getDef_code1())) {
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary1.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary1.get(j))){
								yjyc_cnt = yjyc_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							g_yjyc_cnt = g_yjyc_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary2.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary2.get(j))){
							sy_cnt = sy_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")
									|| ret_prd_jgeList.get(i).getDef_code1().equals("F")){//渗液
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary3.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary3.get(j))){
							if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
								C_hs_cnt = C_hs_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")
										|| ret_prd_jgeList.get(i).getDef_code1().equals("R2")){//划伤
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")
										|| ret_prd_jgeList.get(i).getDef_code1().equals("R1")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}else if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
								T_hs_cnt = T_hs_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")
										|| ret_prd_jgeList.get(i).getDef_code1().equals("R2")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")
										|| ret_prd_jgeList.get(i).getDef_code1().equals("R1")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary4.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary4.get(j))){
							if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
								C_ad_cnt = C_ad_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")
										|| ret_prd_jgeList.get(i).getDef_code1().equals("D")){//凹点
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}else if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
								T_ad_cnt = T_ad_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")
										|| ret_prd_jgeList.get(i).getDef_code1().equals("D")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary5.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary5.get(j))){
							if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
								C_td_cnt = C_td_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")
										|| ret_prd_jgeList.get(i).getDef_code1().equals("A1")){//凸点
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}else if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
								T_td_cnt = T_td_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")
										|| ret_prd_jgeList.get(i).getDef_code1().equals("A1")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary6.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary6.get(j))){
							if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
								C_shbj_cnt = C_shbj_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")
										|| ret_prd_jgeList.get(i).getDef_code1().equals("H1")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}else if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
								T_shbj_cnt = T_shbj_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")
										|| ret_prd_jgeList.get(i).getDef_code1().equals("H1")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary7.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary7.get(j))){
							if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
								C_ps_cnt = C_ps_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")
										|| ret_prd_jgeList.get(i).getDef_code1().equals("B2")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")
										|| ret_prd_jgeList.get(i).getDef_code1().equals("B1")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}else if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
								T_ps_cnt = T_ps_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")
										|| ret_prd_jgeList.get(i).getDef_code1().equals("B2")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")
										|| ret_prd_jgeList.get(i).getDef_code1().equals("B1")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary8.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary8.get(j))){
							if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
								C_zw_cnt = C_zw_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")
										|| ret_prd_jgeList.get(i).getDef_code1().equals("T")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}else if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
								T_zw_cnt = T_zw_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")
										|| ret_prd_jgeList.get(i).getDef_code1().equals("T")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary9.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary9.get(j))){
							if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
								C_ly_cnt = C_ly_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")
										|| ret_prd_jgeList.get(i).getDef_code1().equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}else if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
								T_ly_cnt = T_ly_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")
										|| ret_prd_jgeList.get(i).getDef_code1().equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}
						}
					}
				}else{
					continue;
				}

				if(other_flg_1.equals("N")){
					if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
						C_other = C_other + ret_prd_jgeList.get(i).getDef_code1_cnt();
						if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
						}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
							l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
						}
					}else if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
						T_other = T_other + ret_prd_jgeList.get(i).getDef_code1_cnt();
						if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
						}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
							l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
						}
					}
                }

            }
        }
        /**
         * 获取最大slot_no
         */
		/*if(Integer.parseInt(maxSlotNo) < Integer.parseInt(ret_prd_info.getMtrl_slot_no_fk())){
			maxSlotNo = ret_prd_info.getMtrl_slot_no_fk();
		}*/

        oary.setPrd_seq_id(ret_prd_info.getPrd_seq_id());
        oary.setFab_sn(ret_prd_info.getFab_sn());
//        oary.setSlot_no(ret_prd_info.getMtrl_slot_no_fk());
        oary.setSlot_no(ret_prd_info.getSlot_no());
        oary.setPrd_grade(ret_prd_info.getPrd_grade());
        oary.setYjyc_cnt(yjyc_cnt);
        oary.setSy_cnt(sy_cnt);
        oary.setC_hs_cnt(C_hs_cnt);
        oary.setC_ad_cnt(C_ad_cnt);
        oary.setC_td_cnt(C_td_cnt);
        oary.setC_shbj_cnt(C_shbj_cnt);
        oary.setC_ps_cnt(C_ps_cnt);
        oary.setC_zw_cnt(C_zw_cnt);
        oary.setC_ly_cnt(C_ly_cnt);
        oary.setC_other(C_other);
        oary.setT_hs_cnt(T_hs_cnt);
        oary.setT_ad_cnt(T_ad_cnt);
        oary.setT_td_cnt(T_td_cnt);
        oary.setT_shbj_cnt(T_shbj_cnt);
        oary.setT_ps_cnt(T_ps_cnt);
        oary.setT_zw_cnt(T_zw_cnt);
        oary.setT_ly_cnt(T_ly_cnt);
        oary.setT_other(T_other);
        if(ret_prd_info.getDs_recipe_id() == null){
            oary.setRemark(_SPACE0);
        }else{
            oary.setRemark(ret_prd_info.getDs_recipe_id());
        }
        rtn.setObj(oary);
        outTrx.setDn_no(ret_prd_info.getDn_no());
        modelCnt = ret_prd_info.getX_axis_cnt_fk() * ret_prd_info.getY_axis_cnt_fk();
        outTrx.setModel_cnt(modelCnt);
        return rtn;
    }






	 public SimpleRtnBeen getDefCntForHX(Ret_prd_info ret_prd_info) {
		 Integer C_ad_cnt = 0;
		 Integer C_plp_cnt = 0;
		 Integer C_gs_cnt = 0;
		 Integer C_t3_wgs_cnt = 0;
		 Integer C_hfs_sr_cnt = 0;
		 Integer C_zc_plp_cnt = 0;
		 Integer C_skbj_cnt = 0;
		 Integer C_ito_cnt = 0;
		 Integer C_oemz_wgs_cnt = 0;
		 Integer C_zc_gs_cnt = 0;
		 Integer C_bmzw_cnt = 0;
		 Integer C_td_cnt = 0;

		 Integer T_ad_cnt = 0;
		 Integer T_plp_cnt = 0;
		 Integer T_gs_cnt = 0;
		 Integer T_t3_wgs_cnt = 0;
		 Integer T_hfs_sr_cnt = 0;
		 Integer T_zc_plp_cnt = 0;
		 Integer T_skbj_cnt = 0;
		 Integer T_ito_cnt = 0;
		 Integer T_oemz_wgs_cnt = 0;
		 Integer T_zc_gs_cnt = 0;
		 Integer T_bmzw_cnt = 0;
		 Integer T_td_cnt = 0;
		 //B
		 ArrayList<String> Ary1 = new ArrayList<String>();
		 //L
		 ArrayList<String> Ary2 = new ArrayList<String>();
		 //M
		 ArrayList<String> Ary3 = new ArrayList<String>();
		 //G
		 ArrayList<String> Ary4 = new ArrayList<String>();
		 //J
		 ArrayList<String> Ary5 = new ArrayList<String>();
		 //K
		 ArrayList<String> Ary6 = new ArrayList<String>();
		 //E
		 ArrayList<String> Ary7 = new ArrayList<String>();
		 //H
		 ArrayList<String> Ary8 = new ArrayList<String>();
		 //N
		 ArrayList<String> Ary9 = new ArrayList<String>();
		 //A
		 ArrayList<String> Ary10 = new ArrayList<String>();
		 //I
		 ArrayList<String> Ary11 = new ArrayList<String>();
		 //D
		 ArrayList<String> Ary12 = new ArrayList<String>();

		Ary1.add("B"); //凹点
		Ary2.add("L");//破裂片
		Ary3.add("M");//刮伤
		Ary4.add("G");//微刮伤
		Ary5.add("J");//HF酸
		Ary6.add("K");//破裂片
		Ary7.add("E");//蚀刻不均
		Ary8.add("H");//
		Ary9.add("N");//
		Ary10.add("A");//
		Ary11.add("I");//
		Ary12.add("D");//
		SimpleRtnBeen rtn = new SimpleRtnBeen();
		Xpinqdef007 oary = new Xpinqdef007();
		List<Ret_prd_jge> ret_prd_jgeList = new ArrayList<Ret_prd_jge>();
		String sql = "From Ret_prd_jge WHERE id.prd_seq_id_fk = '" + ret_prd_info.getPrd_seq_id()  + "' AND lst_judge_flg='Y' AND proc_id<>'JBYZ'";

		ret_prd_jgeList = retPrdJgeDao.find(sql);
		for (int i=0;i<ret_prd_jgeList.size();i++) {
			String other_flg_1 = "N";
			if (!Util.isSpaceCheck(ret_prd_jgeList.get(i).getDef_code1())) {
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary1.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary1.get(j))){ //凹点
							C_ad_cnt = C_ad_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary2.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary2.get(j))){
							C_plp_cnt = C_plp_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary2.get(j))){  //破裂片
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary3.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary3.get(j))){
								C_gs_cnt = C_gs_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary3.get(j))){//划伤
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary4.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary4.get(j))){
							C_t3_wgs_cnt = C_t3_wgs_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
						//	if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary4.get(j))){//划伤
							//	p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
						//	}
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary5.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary5.get(j))){
							C_hfs_sr_cnt = C_hfs_sr_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary5.get(j))){//划伤
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary6.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary6.get(j))){
							C_zc_plp_cnt = C_zc_plp_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary6.get(j))){//划伤
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary7.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary7.get(j))){
							C_skbj_cnt = C_skbj_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary7.get(j))){//划伤
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}

				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary8.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary8.get(j))){
							C_ito_cnt = C_ito_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary8.get(j))){//划伤
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary9.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary9.get(j))){
							C_oemz_wgs_cnt = C_oemz_wgs_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
					//		if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary9.get(j))){//划伤
					//			p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
					//		}
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary10.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary10.get(j))){
							C_zc_gs_cnt = C_zc_gs_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary10.get(j))){//划伤
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary11.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary11.get(j))){
							C_bmzw_cnt = C_bmzw_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary11.get(j))){//划伤
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary12.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary12.get(j))){
							C_td_cnt = C_td_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary12.get(j))){//划伤
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
			}
		}
		/**
		 * 获取最大slot_no
		 */
		/*if(Integer.parseInt(maxSlotNo) < Integer.parseInt(ret_prd_info.getMtrl_slot_no_fk())){
			maxSlotNo = ret_prd_info.getMtrl_slot_no_fk();
		}*/

		oary.setPrd_seq_id(ret_prd_info.getPrd_seq_id());
		oary.setFab_sn(ret_prd_info.getFab_sn());
		oary.setSlot_no(ret_prd_info.getMtrl_slot_no_fk());
		oary.setSlot_no(ret_prd_info.getSlot_no());
		oary.setPrd_grade(ret_prd_info.getPrd_grade());
//		oary.setYjyc_cnt();
//		oary.setSy_cnt();
		oary.setC_ad_cnt(C_ad_cnt);
		oary.setC_plp_cnt(C_plp_cnt);
		oary.setC_gs_cnt(C_gs_cnt);
		oary.setC_t3_wgs_cnt(C_t3_wgs_cnt);
		oary.setC_hfs_sr_cnt(C_hfs_sr_cnt);
		oary.setC_zc_plp_cnt(C_zc_plp_cnt);
		oary.setC_skbj_cnt(C_skbj_cnt);
		oary.setC_ito_cnt(C_ito_cnt);
		oary.setC_oemz_wgs_cnt(C_oemz_wgs_cnt);
		oary.setC_zc_gs_cnt(C_zc_gs_cnt);
		oary.setC_bmzw_cnt(C_bmzw_cnt);
		oary.setC_td_cnt(C_td_cnt);

		if(ret_prd_info.getDs_recipe_id() == null){
			oary.setRemark(_SPACE0);
		}else{
			oary.setRemark(ret_prd_info.getDs_recipe_id());
		}
		rtn.setObj(oary);
		outTrx.setDn_no(ret_prd_info.getDn_no());
		modelCnt = ret_prd_info.getX_axis_cnt_fk() * ret_prd_info.getY_axis_cnt_fk();
		outTrx.setModel_cnt(modelCnt);
		return rtn;
	}
	/**
	 * 008客户
	 */
	public SimpleRtnBeen getDefCntFor008(Ret_prd_info ret_prd_info) {
		int l_ly_cnt = 0;
		int l_llxo_cnt = 0;
		int l_hnbl_cnt = 0;
		int l_pl_cnt = 0;
		int z_c_skbj_cnt = 0;
		int z_c_dqx_cnt = 0;
		int z_c_xqx_cnt = 0;
		int z_c_wj_cnt = 0;
		int z_t_skbj_cnt = 0;
		int z_t_dqx_cnt = 0;
		int z_t_xqx_cnt = 0;
		int z_t_wj_cnt = 0;
		int z_t_pit_cnt = 0;
		int jbpl_cnt = 0;
		int jbly_cnt = 0;

		/**
		 * 来料不良
		 */
		//轮印
		ArrayList<String> lAry1 = new ArrayList<String>();
		//来料划X\O
		ArrayList<String> lAry2 = new ArrayList<String>();
		//盒内不良
		ArrayList<String> lAry3 = new ArrayList<String>();
		//破裂
		ArrayList<String> lAry4 = new ArrayList<String>();
		/**
		 * 制程不良
		 */
		//CF面蚀刻不均
		ArrayList<String> zcAry1 = new ArrayList<String>();
		//CF面点缺陷
		ArrayList<String> zcAry2 = new ArrayList<String>();
		//CF面线缺陷
		ArrayList<String> zcAry3 = new ArrayList<String>();
		//CF面污迹
		ArrayList<String> zcAry4 = new ArrayList<String>();
		//TFT面蚀刻不均
		ArrayList<String> ztAry1 = new ArrayList<String>();
		//TFT面点缺陷
		ArrayList<String> ztAry2 = new ArrayList<String>();
		//TFT面线缺陷
		ArrayList<String> ztAry3 = new ArrayList<String>();
		//TFT面污迹
		ArrayList<String> ztAry4 = new ArrayList<String>();
		//TFT面pit点
		ArrayList<String> ztAry5 = new ArrayList<String>();
		/**
		 * 减薄制程不良
		 */
		//破裂
		ArrayList<String> jbAry1 = new ArrayList<String>();
		//漏液
		ArrayList<String> jbAry2 = new ArrayList<String>();
		
		if(inTrx.getProc_id().equals("JBQA")){//减薄QA
			lAry1.add("L004");
			lAry2.add("L014");lAry2.add("L015");
			lAry3.add("L001");lAry3.add("L018");lAry3.add("L052");lAry3.add("L013");
			lAry4.add("L002");lAry4.add("L005");
			zcAry1.add("Z011");zcAry1.add("Z015");
			zcAry2.add("Z002");zcAry2.add("Z003");
			zcAry3.add("Z001");
			zcAry4.add("Z008");
			ztAry1.add("Z011");ztAry1.add("Z015");ztAry1.add("Z014");
			ztAry2.add("Z002");ztAry2.add("Z003");
			ztAry3.add("Z001");
			ztAry4.add("Z008");
			ztAry5.add("Z003");
			jbAry1.add("Z004");jbAry1.add("Z005");jbAry1.add("Z007");
			jbAry2.add("Z009");jbAry2.add("Z010");
		}else{
			lAry1.add("L004");
			lAry2.add("L014");lAry2.add("L015");
			lAry3.add("L001");lAry3.add("L018");lAry3.add("L052");lAry3.add("L013");
			lAry4.add("L002");lAry4.add("L005");
			zcAry1.add("Z011");zcAry1.add("Z015");
			zcAry2.add("Z002");zcAry2.add("Z003");
			zcAry3.add("Z001");
			zcAry4.add("Z008");
			ztAry1.add("Z011");ztAry1.add("Z015");
			ztAry2.add("Z002");ztAry2.add("Z003");
			ztAry3.add("Z001");
			ztAry4.add("Z008");
			ztAry5.add("Z003");
			jbAry1.add("Z004");jbAry1.add("Z005");jbAry1.add("Z007");
			jbAry2.add("Z009");jbAry2.add("Z010");
		}
		SimpleRtnBeen rtn = new SimpleRtnBeen();
		Xpinqdef008 oary008 = new Xpinqdef008();
		List<Ret_prd_jge> ret_prd_jgeList = new ArrayList<Ret_prd_jge>();
		String sql = "From Ret_prd_jge WHERE id.prd_seq_id_fk = '" + ret_prd_info.getPrd_seq_id()  + "' AND lst_judge_flg='Y' AND proc_id<>'JBYZ'";
		ret_prd_jgeList = retPrdJgeDao.find(sql);
		for (int i=0;i<ret_prd_jgeList.size();i++) {
			String other_flg_1 = "N";
			if (!Util.isSpaceCheck(ret_prd_jgeList.get(i).getDef_code1())) {
				if(other_flg_1.equals("N")){
					for(int j=0;j<lAry1.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(lAry1.get(j))){
							l_ly_cnt = l_ly_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<lAry2.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(lAry2.get(j))){
							l_llxo_cnt = l_llxo_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<lAry3.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(lAry3.get(j))){
							l_hnbl_cnt = l_hnbl_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<lAry4.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(lAry4.get(j))){
							l_pl_cnt = l_pl_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<zcAry1.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(zcAry1.get(j)) && 
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							z_c_skbj_cnt = z_c_skbj_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<zcAry2.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(zcAry2.get(j)) && 
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							z_c_dqx_cnt = z_c_dqx_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<zcAry3.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(zcAry3.get(j)) && 
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							z_c_xqx_cnt = z_c_xqx_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<zcAry4.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(zcAry4.get(j)) && 
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							z_c_wj_cnt = z_c_wj_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<ztAry1.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(ztAry1.get(j)) && 
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
							z_t_skbj_cnt = z_t_skbj_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<ztAry2.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(ztAry2.get(j)) && 
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
							z_t_dqx_cnt = z_t_dqx_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<ztAry3.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(ztAry3.get(j)) && 
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
							z_t_xqx_cnt = z_t_xqx_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<ztAry4.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(ztAry4.get(j)) && 
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
							z_t_wj_cnt = z_t_wj_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<ztAry5.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(ztAry5.get(j)) && 
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
							z_t_pit_cnt = z_t_pit_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<jbAry1.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(jbAry1.get(j))){
							jbpl_cnt = jbpl_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<jbAry2.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(jbAry2.get(j))){
							jbly_cnt = jbly_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}
			}
		}
		
		/**
		 * 获取最大slot_no
		 */
		if(Integer.parseInt(maxSlotNo) < Integer.parseInt(ret_prd_info.getSlot_no())){
			maxSlotNo = ret_prd_info.getSlot_no();
		}
		
		oary008.setL_ly_cnt(l_ly_cnt);
		oary008.setL_llxo_cnt(l_llxo_cnt);
		oary008.setL_hnbl_cnt(l_hnbl_cnt);
		oary008.setL_pl_cnt(l_pl_cnt);
		oary008.setZ_c_skbj_cnt(z_c_skbj_cnt);
		oary008.setZ_c_dqx_cnt(z_c_dqx_cnt);
		oary008.setZ_c_xqx_cnt(z_c_xqx_cnt);
		oary008.setZ_c_wj_cnt(z_c_wj_cnt);
		oary008.setZ_t_skbj_cnt(z_t_skbj_cnt);
		oary008.setZ_t_dqx_cnt(z_t_dqx_cnt);
		oary008.setZ_t_xqx_cnt(z_t_xqx_cnt);
		oary008.setZ_t_wj_cnt(z_t_wj_cnt);
		oary008.setZ_t_pit_cnt(z_t_pit_cnt);
		oary008.setJbpl_cnt(jbpl_cnt);
		oary008.setJbly_cnt(jbly_cnt);
		oary008.setPrd_seq_id(ret_prd_info.getPrd_seq_id());
		oary008.setFab_sn(ret_prd_info.getFab_sn());
		oary008.setSlot_no(ret_prd_info.getSlot_no());
		if(Util.isSpaceCheck(ret_prd_info.getDs_recipe_id())){
			oary008.setRemark(_SPACE0);
		}else{
			oary008.setRemark(ret_prd_info.getDs_recipe_id());
		}
		rtn.setObj(oary008);
		outTrx.setDn_no(ret_prd_info.getDn_no());
		modelCnt = ret_prd_info.getX_axis_cnt_fk() * ret_prd_info.getY_axis_cnt_fk();
		outTrx.setModel_cnt(modelCnt);
		return rtn;
	}
	
	/**
	 * for 028,071,088
	 * @param ret_prd_info
	 * @return
	 */
	public SimpleRtnBeen getDefCntForTM(String woCate, Ret_prd_info ret_prd_info) {
		Integer yjyc_cnt = 0;
		Integer sy_cnt = 0;
		Integer C_hs_cnt = 0;
		Integer C_ad_cnt = 0;
		Integer C_td_cnt = 0;
		Integer C_shbj_cnt = 0;
		Integer C_ps_cnt = 0;
		Integer C_zw_cnt = 0;
		Integer C_ly_cnt = 0;
		Integer C_other = 0;
		Integer T_hs_cnt = 0;
		Integer T_ad_cnt = 0;
		Integer T_td_cnt = 0;
		Integer T_shbj_cnt = 0;
		Integer T_ps_cnt = 0;
		Integer T_zw_cnt = 0;
		Integer T_ly_cnt = 0;
		Integer T_other = 0;
		//液晶异常
		ArrayList<String> Ary1 = new ArrayList<String>();
		//渗液
		ArrayList<String> Ary2 = new ArrayList<String>();
		//划伤
		ArrayList<String> Ary3 = new ArrayList<String>();
		//凹点
		ArrayList<String> t_Ary4 = new ArrayList<String>();
		ArrayList<String> c_Ary4 = new ArrayList<String>();
		//凸点
		ArrayList<String> Ary5 = new ArrayList<String>();
		//酸蚀不均
		ArrayList<String> Ary6 = new ArrayList<String>();
		//破损
		ArrayList<String> Ary7 = new ArrayList<String>();
		//脏污
		ArrayList<String> Ary8 = new ArrayList<String>();
		//轮印
		ArrayList<String> Ary9 = new ArrayList<String>();
		
		if(inTrx.getProc_id().equals("JBQA")){//减薄QA
			Ary1.add("L001");Ary1.add("L018");Ary1.add("L052");//液晶异常
			Ary1.add("L013");Ary1.add("L014");Ary1.add("L015");
			Ary1.add("L051");
			Ary2.add("Z009");Ary2.add("Z010");Ary2.add("Z006");//渗液
			Ary3.add("L003");Ary3.add("Z001");//划伤
			t_Ary4.add("L009");t_Ary4.add("L010");//凹点for T面
			t_Ary4.add("L053");t_Ary4.add("Z002");
			t_Ary4.add("L008");t_Ary4.add("Z003");
			c_Ary4.add("L009");c_Ary4.add("L010");//凹点for C面
			c_Ary4.add("L053");c_Ary4.add("Z002");
			Ary5.add("Z039");//凸点
			Ary6.add("Z011");Ary6.add("Z015");Ary6.add("Z014");//酸蚀不均
			Ary7.add("L002");Ary7.add("L005");Ary7.add("Z004");//破损
			Ary7.add("Z005");Ary7.add("Z007");
			Ary8.add("Z008");//脏污
			Ary9.add("L004");//轮印
		}else{//镀膜QA
			Ary1.add("L001");Ary1.add("L018");Ary1.add("L052");//液晶异常
			Ary1.add("L013");Ary1.add("L014");Ary1.add("L015");
			Ary2.add("Z009");Ary2.add("Z010");//渗液
			Ary3.add("L003");Ary3.add("Z001");//划伤
			t_Ary4.add("L008");t_Ary4.add("L009");t_Ary4.add("L010");//凹点
			t_Ary4.add("L053");t_Ary4.add("Z002");t_Ary4.add("Z003");
			Ary5.add("Z039");//凸点
			Ary6.add("Z011");Ary6.add("Z015");//酸蚀不均
			Ary7.add("L002");Ary7.add("L005");Ary7.add("Z004");//破损
			Ary7.add("Z005");Ary7.add("Z007");
			Ary8.add("Z008");//脏污
			Ary9.add("L004");//轮印
		}
		
		SimpleRtnBeen rtn = new SimpleRtnBeen();
    	XpinqdefOC oary = new XpinqdefOC();
		List<Ret_prd_jge> ret_prd_jgeList = new ArrayList<Ret_prd_jge>();
		String sql = "From Ret_prd_jge WHERE id.prd_seq_id_fk = '" + ret_prd_info.getPrd_seq_id()  + "' AND lst_judge_flg='Y' AND proc_id<>'JBYZ'";
		
		ret_prd_jgeList = retPrdJgeDao.find(sql);
		for (int i=0;i<ret_prd_jgeList.size();i++) {
			String other_flg_1 = "N";
			if (!Util.isSpaceCheck(ret_prd_jgeList.get(i).getDef_code1())) {
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary1.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary1.get(j))){
							yjyc_cnt = yjyc_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary2.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary2.get(j))){
							sy_cnt = sy_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary3.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary3.get(j))){
							if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
								C_hs_cnt = C_hs_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}else if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
								T_hs_cnt = T_hs_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					if(inTrx.getProc_id().equals("JBQA")){//减薄QA
						if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							for(int j=0;j<c_Ary4.size();j++){
								if(ret_prd_jgeList.get(i).getDef_code1().equals(c_Ary4.get(j))){
									C_ad_cnt = C_ad_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
									if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
										p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
									}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
										l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
									}
									other_flg_1 = "Y";
									break;
								}
							}
						}else if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
							for(int j=0;j<t_Ary4.size();j++){
								if(ret_prd_jgeList.get(i).getDef_code1().equals(t_Ary4.get(j))){
									T_ad_cnt = T_ad_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
									if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
										p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
									}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
										l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
									}
									other_flg_1 = "Y";
									break;
								}
							}
						}
					}else{//镀膜QA
						for(int j=0;j<t_Ary4.size();j++){
							if(ret_prd_jgeList.get(i).getDef_code1().equals(t_Ary4.get(j))){
								if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
									C_ad_cnt = C_ad_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
									if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
										p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
									}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
										l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
									}
									other_flg_1 = "Y";
									break;
								}else if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
									T_ad_cnt = T_ad_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
									if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
										p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
									}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
										l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
									}
									other_flg_1 = "Y";
									break;
								}
							}
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary5.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary5.get(j))){
							if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
								C_td_cnt = C_td_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}else if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
								T_td_cnt = T_td_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary6.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary6.get(j))){
							if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
								C_shbj_cnt = C_shbj_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}else if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
								T_shbj_cnt = T_shbj_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary7.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary7.get(j))){
							if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
								C_ps_cnt = C_ps_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}else if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
								T_ps_cnt = T_ps_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary8.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary8.get(j))){
							if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
								C_zw_cnt = C_zw_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}else if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
								T_zw_cnt = T_zw_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary9.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary9.get(j))){
							if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
								C_ly_cnt = C_ly_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}else if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
								T_ly_cnt = T_ly_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}
						}
					}
				}else{
					continue;
				}

				if(other_flg_1.equals("N")){
					if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
						C_other = C_other + ret_prd_jgeList.get(i).getDef_code1_cnt();
						if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
						}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
							l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
						}
					}else if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
						T_other = T_other + ret_prd_jgeList.get(i).getDef_code1_cnt();
						if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
						}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
							l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
						}
					}
				}

			}
		}
		/**
		 * 获取最大slot_no
		 */
	    if(Integer.parseInt(maxSlotNo) < Integer.parseInt(ret_prd_info.getMtrl_slot_no_fk())){
		   maxSlotNo = ret_prd_info.getMtrl_slot_no_fk();
	    }
		
		if("ONCE".equals(woCate) && ret_prd_info.getPrd_seq_id().length() > 10){//oncell产品截取10位
			oary.setPrd_seq_id(ret_prd_info.getPrd_seq_id().substring(0, 10));
			oary.setFab_sn(ret_prd_info.getFab_sn().substring(0, 10));
		}else{
			oary.setPrd_seq_id(ret_prd_info.getPrd_seq_id());
			oary.setFab_sn(ret_prd_info.getFab_sn());
		}
		
		oary.setSlot_no(ret_prd_info.getMtrl_slot_no_fk());
		oary.setPrd_grade(ret_prd_info.getPrd_grade());
		oary.setYjyc_cnt(yjyc_cnt);
		oary.setSy_cnt(sy_cnt);
		oary.setC_hs_cnt(C_hs_cnt);
		oary.setC_ad_cnt(C_ad_cnt);
		oary.setC_td_cnt(C_td_cnt);
		oary.setC_shbj_cnt(C_shbj_cnt);
		oary.setC_ps_cnt(C_ps_cnt);
		oary.setC_zw_cnt(C_zw_cnt);
		oary.setC_ly_cnt(C_ly_cnt);
		oary.setC_other(C_other);
		oary.setT_hs_cnt(T_hs_cnt);
		oary.setT_ad_cnt(T_ad_cnt);
		oary.setT_td_cnt(T_td_cnt);
		oary.setT_shbj_cnt(T_shbj_cnt);
		oary.setT_ps_cnt(T_ps_cnt);
		oary.setT_zw_cnt(T_zw_cnt);
		oary.setT_ly_cnt(T_ly_cnt);
		oary.setT_other(T_other);
		if(ret_prd_info.getDs_recipe_id() == null){
			oary.setRemark(_SPACE0);
		}else{
			oary.setRemark(ret_prd_info.getDs_recipe_id());
		}
		rtn.setObj(oary);
		outTrx.setDn_no(ret_prd_info.getDn_no());
		modelCnt = ret_prd_info.getX_axis_cnt_fk() * ret_prd_info.getY_axis_cnt_fk();
		outTrx.setModel_cnt(modelCnt);
		return rtn;
	}
	
	/**
	 * for 063
	 * @param ret_prd_info 不需要统计DEF情况
	 * @return
	 */

	public SimpleRtnBeen getDefCntFor063(Ret_prd_info ret_prd_info) {
		
		SimpleRtnBeen rtn = new SimpleRtnBeen();
		Xpinqdef063 oary063 = new Xpinqdef063();
		
		List<Ret_prd_jge> ret_prd_jgeList = new ArrayList<Ret_prd_jge>();
		String sql = "From Ret_prd_jge WHERE id.prd_seq_id_fk = '" + ret_prd_info.getPrd_seq_id()  + "' AND lst_judge_flg='Y' AND proc_id<>'JBYZ'";
		ret_prd_jgeList = retPrdJgeDao.find(sql);
		for (int i=0;i<ret_prd_jgeList.size();i++) {
			if (!Util.isSpaceCheck(ret_prd_jgeList.get(i).getDef_code1())) {
				if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
					p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
				}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
					l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
				}
			}
		}
		/**
		 * 获取最大slot_no
		 */
		if(Integer.parseInt(maxSlotNo) < Integer.parseInt(ret_prd_info.getSlot_no())){
			maxSlotNo = ret_prd_info.getSlot_no();
		}
		oary063.setPrd_seq_id(ret_prd_info.getPrd_seq_id());
		oary063.setFab_sn(ret_prd_info.getFab_sn());
		oary063.setMtrl_box_id_fk(ret_prd_info.getMtrl_box_id_fk());
		oary063.setSlot_no(ret_prd_info.getSlot_no());
		oary063.setPrd_grade(ret_prd_info.getPrd_grade());
		if(Util.isSpaceCheck(ret_prd_info.getDs_recipe_id())){
			oary063.setRemark("良品");
		}else{
			oary063.setRemark(ret_prd_info.getDs_recipe_id());
		}
		rtn.setObj(oary063);
		outTrx.setDn_no(ret_prd_info.getDn_no());
		modelCnt = ret_prd_info.getX_axis_cnt_fk() * ret_prd_info.getY_axis_cnt_fk();
		outTrx.setModel_cnt(modelCnt);
		return rtn;
	}

	/**
	 * for 098JBQA
	 * @param ret_prd_info
	 * @return
	 */
	public SimpleRtnBeen getDefCntFor098JBQA(Ret_prd_info ret_prd_info) {
		Integer C_z_pl_cnt = 0;
		Integer C_z_ly_cnt = 0;
		Integer C_z_zw_cnt = 0;
		Integer C_z_skbj_cnt = 0;
		Integer C_z_atd_cnt = 0; 
		Integer C_z_hs_cnt = 0;  
		Integer C_l_pl_cnt = 0;  
		Integer C_l_yjyc_cnt = 0;
		Integer C_l_ad_cnt = 0;  
		Integer C_l_mjad_cnt = 0;
		Integer C_l_hs_cnt = 0;  
		Integer C_l_gly_cnt = 0; 
		Integer T_z_zw_cnt = 0;  
		Integer T_z_skbj_cnt = 0;
		Integer T_z_atd_cnt = 0; 
		Integer T_z_hs_cnt = 0;  
		Integer T_l_ad_cnt = 0;  
		Integer T_l_hs_cnt = 0;  
		Integer T_l_gly_cnt = 0; 
		/**
		 * CF面制程
		 */
		//破裂
		ArrayList<String> C_z_Ary1 = new ArrayList<String>();
		C_z_Ary1.add("Z004");C_z_Ary1.add("Z005");
		//漏液
		ArrayList<String> C_z_Ary2 = new ArrayList<String>();
		C_z_Ary2.add("Z009");C_z_Ary2.add("Z010");C_z_Ary2.add("Z006");
		//脏污
		ArrayList<String> C_z_Ary3 = new ArrayList<String>();
		C_z_Ary3.add("Z008");
		//蚀刻不均
		ArrayList<String> C_z_Ary4 = new ArrayList<String>();
		C_z_Ary4.add("Z011");C_z_Ary4.add("Z015");C_z_Ary4.add("Z014");
		//凹凸点
		ArrayList<String> C_z_Ary5 = new ArrayList<String>();
		C_z_Ary5.add("Z039");C_z_Ary5.add("Z002");
		//划伤
		ArrayList<String> C_z_Ary6 = new ArrayList<String>();
		C_z_Ary6.add("Z001");
		/**
		 * CF面来料不良
		 */
		//破裂
		ArrayList<String> C_l_Ary1 = new ArrayList<String>();
		C_l_Ary1.add("L002");C_l_Ary1.add("L005");
		//液晶异常
		ArrayList<String> C_l_Ary2 = new ArrayList<String>();
		C_l_Ary2.add("L001");C_l_Ary2.add("L018");C_l_Ary2.add("L052");
		C_l_Ary2.add("L013");C_l_Ary2.add("L014");C_l_Ary2.add("L015");
		C_l_Ary2.add("L051");
		//凹点
		ArrayList<String> C_l_Ary3 = new ArrayList<String>();
		C_l_Ary3.add("L053");
		//密集凹点
		ArrayList<String> C_l_Ary4 = new ArrayList<String>();
		C_l_Ary4.add("L009");C_l_Ary4.add("L010");
		//划伤
		ArrayList<String> C_l_Ary5 = new ArrayList<String>();
		C_l_Ary5.add("L003");
		//滚轮印
		ArrayList<String> C_l_Ary6 = new ArrayList<String>();
		C_l_Ary6.add("L004");
		/**
		 * TFT面制程
		 */
		//脏污
		ArrayList<String> T_z_Ary1 = new ArrayList<String>();
		T_z_Ary1.add("Z008");
		//蚀刻不均
		ArrayList<String> T_z_Ary2 = new ArrayList<String>();
		T_z_Ary2.add("Z011");T_z_Ary2.add("Z015");T_z_Ary2.add("Z014");
		//凸点
		ArrayList<String> T_z_Ary3 = new ArrayList<String>();
		T_z_Ary3.add("Z039");T_z_Ary3.add("Z002");
		//划伤
		ArrayList<String> T_z_Ary4 = new ArrayList<String>();
		T_z_Ary4.add("Z001");
		/**
		 * TFT面来料不良 
		 */
		//凹点
		ArrayList<String> T_l_Ary1 = new ArrayList<String>();
		T_l_Ary1.add("L008");T_l_Ary1.add("L009");T_l_Ary1.add("L010");
		//划伤
		ArrayList<String> T_l_Ary2 = new ArrayList<String>();
		T_l_Ary2.add("L003");
		//滚轮印
		ArrayList<String> T_l_Ary3 = new ArrayList<String>();
		T_l_Ary3.add("L004");
		
		SimpleRtnBeen rtn = new SimpleRtnBeen();
    	Xpinqdef006 oary006 = new Xpinqdef006();
		List<Ret_prd_jge> ret_prd_jgeList = new ArrayList<Ret_prd_jge>();
		String sql = "From Ret_prd_jge WHERE id.prd_seq_id_fk = '" + ret_prd_info.getPrd_seq_id()  + "' AND lst_judge_flg='Y' AND proc_id<>'JBYZ'";
		
		ret_prd_jgeList = retPrdJgeDao.find(sql);
		for (int i=0;i<ret_prd_jgeList.size();i++) {
			String other_flg_1 = "N";
			if (!Util.isSpaceCheck(ret_prd_jgeList.get(i).getDef_code1())) {
				if(other_flg_1.equals("N")){//CF面制程破裂
					for(int j=0;j<C_z_Ary1.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(C_z_Ary1.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							C_z_pl_cnt = C_z_pl_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//CF面制程漏液
					for(int j=0;j<C_z_Ary2.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(C_z_Ary2.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							C_z_ly_cnt = C_z_ly_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//CF面制程脏污
					for(int j=0;j<C_z_Ary3.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(C_z_Ary3.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							C_z_zw_cnt = C_z_zw_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//CF面制程蚀刻不均
					for(int j=0;j<C_z_Ary4.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(C_z_Ary4.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							C_z_skbj_cnt = C_z_skbj_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//CF面制程凹凸点
					for(int j=0;j<C_z_Ary5.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(C_z_Ary5.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							C_z_atd_cnt = C_z_atd_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//CF面制程划伤
					for(int j=0;j<C_z_Ary6.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(C_z_Ary6.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							C_z_hs_cnt = C_z_hs_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//CF面来料不良破裂
					for(int j=0;j<C_l_Ary1.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(C_l_Ary1.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							C_l_pl_cnt = C_l_pl_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//CF面来料不良液晶异常
					for(int j=0;j<C_l_Ary2.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(C_l_Ary2.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							C_l_yjyc_cnt = C_l_yjyc_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//CF面来料不良凹点 
					for(int j=0;j<C_l_Ary3.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(C_l_Ary3.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							C_l_ad_cnt = C_l_ad_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}

				if(other_flg_1.equals("N")){//CF面来料不良密集凹点
					for(int j=0;j<C_l_Ary4.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(C_l_Ary4.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							C_l_mjad_cnt = C_l_mjad_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//CF面来料不良划伤 
					for(int j=0;j<C_l_Ary5.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(C_l_Ary5.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							C_l_hs_cnt = C_l_hs_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}

				if(other_flg_1.equals("N")){//CF面来料不良滚轮印
					for(int j=0;j<C_l_Ary6.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(C_l_Ary6.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
							C_l_gly_cnt = C_l_gly_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//TFT面制程脏污
					for(int j=0;j<T_z_Ary1.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(T_z_Ary1.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
							T_z_zw_cnt = T_z_zw_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//TFT面制程蚀刻不均
					for(int j=0;j<T_z_Ary2.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(T_z_Ary2.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
							T_z_skbj_cnt = T_z_skbj_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//TFT面制程凸点
					for(int j=0;j<T_z_Ary3.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(T_z_Ary3.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
							T_z_atd_cnt = T_z_atd_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//TFT面制程划伤
					for(int j=0;j<T_z_Ary4.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(T_z_Ary4.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
							T_z_hs_cnt = T_z_hs_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//TFT面来料不良凹点
					for(int j=0;j<T_l_Ary1.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(T_l_Ary1.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
							T_l_ad_cnt = T_l_ad_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//TFT面来料不良划伤
					for(int j=0;j<T_l_Ary2.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(T_l_Ary2.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
							T_l_hs_cnt = T_l_hs_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//TFT面来料不良滚轮印
					for(int j=0;j<T_l_Ary3.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(T_l_Ary3.get(j)) &&
								ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
							T_l_gly_cnt = T_l_gly_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
			}
		}
		/**
		 * 获取最大slot_no
		 */
		if(Integer.parseInt(maxSlotNo) < Integer.parseInt(ret_prd_info.getSlot_no())){
			maxSlotNo = ret_prd_info.getSlot_no();
		}
		
		oary006.setPrd_seq_id(ret_prd_info.getPrd_seq_id());
		oary006.setFab_sn(ret_prd_info.getFab_sn());
		oary006.setSlot_no(ret_prd_info.getSlot_no());
		oary006.setMtrl_box_id_fk(ret_prd_info.getMtrl_box_id_fk());
		oary006.setPrd_grade(ret_prd_info.getPrd_grade());
		oary006.setC_z_pl_cnt(C_z_pl_cnt);
		oary006.setC_z_ly_cnt(C_z_ly_cnt);
		oary006.setC_z_zw_cnt(C_z_zw_cnt);
		oary006.setC_z_skbj_cnt(C_z_skbj_cnt);
		oary006.setC_z_atd_cnt(C_z_atd_cnt);
		oary006.setC_z_hs_cnt(C_z_hs_cnt);
		oary006.setC_l_pl_cnt(C_l_pl_cnt);
		oary006.setC_l_yjyc_cnt(C_l_yjyc_cnt);
		oary006.setC_l_ad_cnt(C_l_ad_cnt);
		oary006.setC_l_mjad_cnt(C_l_mjad_cnt);
		oary006.setC_l_hs_cnt(C_l_hs_cnt);
		oary006.setC_l_gly_cnt(C_l_gly_cnt);
		oary006.setT_z_zw_cnt(T_z_zw_cnt);
		oary006.setT_z_skbj_cnt(T_z_skbj_cnt);
		oary006.setT_z_atd_cnt(T_z_atd_cnt);
		oary006.setT_z_hs_cnt(T_z_hs_cnt);
		oary006.setT_l_ad_cnt(T_l_ad_cnt);
		oary006.setT_l_hs_cnt(T_l_hs_cnt);
		oary006.setT_l_gly_cnt(T_l_gly_cnt);
		
		if(ret_prd_info.getDs_recipe_id() == null){
			oary006.setRemark(_SPACE0);
		}else{
			oary006.setRemark(ret_prd_info.getDs_recipe_id());
		}
		rtn.setObj(oary006);
		outTrx.setDn_no(ret_prd_info.getDn_no());
		modelCnt = ret_prd_info.getX_axis_cnt_fk() * ret_prd_info.getY_axis_cnt_fk();
		outTrx.setModel_cnt(modelCnt);
		return rtn;
	}
	
	/**
	 * 098DMQA
	 * @param ret_prd_info
	 * @return
	 */
	public SimpleRtnBeen getDefCntFor098DMQA(Ret_prd_info ret_prd_info) {
		Integer yjyc_cnt = 0;
		Integer sy_cnt = 0;
		Integer C_hs_cnt = 0;
		Integer C_ad_cnt = 0;
		Integer C_td_cnt = 0;
		Integer C_shbj_cnt = 0;
		Integer C_ps_cnt = 0;
		Integer C_zw_cnt = 0;
		Integer C_ly_cnt = 0;
		Integer C_other = 0;
		Integer T_hs_cnt = 0;
		Integer T_ad_cnt = 0;
		Integer T_td_cnt = 0;
		Integer T_shbj_cnt = 0;
		Integer T_ps_cnt = 0;
		Integer T_zw_cnt = 0;
		Integer T_ly_cnt = 0;
		Integer T_other = 0;
		//液晶异常
		ArrayList<String> Ary1 = new ArrayList<String>();
		//渗液
		ArrayList<String> Ary2 = new ArrayList<String>();
		//划伤
		ArrayList<String> Ary3 = new ArrayList<String>();
		//凹点
		ArrayList<String> Ary4 = new ArrayList<String>();
		//凸点
		ArrayList<String> Ary5 = new ArrayList<String>();
		//酸蚀不均
		ArrayList<String> Ary6 = new ArrayList<String>();
		//破损
		ArrayList<String> Ary7 = new ArrayList<String>();
		//脏污
		ArrayList<String> Ary8 = new ArrayList<String>();
		//轮印
		ArrayList<String> Ary9 = new ArrayList<String>();
		
		Ary1.add("L001");Ary1.add("L018");Ary1.add("L052");
		Ary1.add("L013");Ary1.add("L014");Ary1.add("L015");
		Ary2.add("Z009");Ary2.add("Z010");
		Ary3.add("L003");Ary3.add("Z001");
		Ary4.add("L008");Ary4.add("L009");Ary4.add("L010");
		Ary4.add("L053");Ary4.add("Z002");Ary4.add("Z003");
		Ary5.add("Z039");
		Ary6.add("Z011");Ary6.add("Z015");
		Ary7.add("L002");Ary7.add("L005");Ary7.add("Z004");
		Ary7.add("Z005");Ary7.add("Z007");
		Ary8.add("Z008");
		Ary9.add("L004");	
		
		SimpleRtnBeen rtn = new SimpleRtnBeen();
    	XpinqdefOC oary = new XpinqdefOC();
		List<Ret_prd_jge> ret_prd_jgeList = new ArrayList<Ret_prd_jge>();
		String sql = "From Ret_prd_jge WHERE id.prd_seq_id_fk = '" + ret_prd_info.getPrd_seq_id()  + "' AND lst_judge_flg='Y' AND proc_id<>'JBYZ'";
		
		ret_prd_jgeList = retPrdJgeDao.find(sql);
		for (int i=0;i<ret_prd_jgeList.size();i++) {
			String other_flg_1 = "N";
			if (!Util.isSpaceCheck(ret_prd_jgeList.get(i).getDef_code1())) {
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary1.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary1.get(j))){
							yjyc_cnt = yjyc_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							g_yjyc_cnt = g_yjyc_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary2.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary2.get(j))){
							sy_cnt = sy_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary3.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary3.get(j))){
							if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
								C_hs_cnt = C_hs_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}else if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
								T_hs_cnt = T_hs_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary4.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary4.get(j))){
							if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
								C_ad_cnt = C_ad_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}else if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
								T_ad_cnt = T_ad_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary5.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary5.get(j))){
							if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
								C_td_cnt = C_td_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}else if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
								T_td_cnt = T_td_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary6.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary6.get(j))){
							if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
								C_shbj_cnt = C_shbj_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}else if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
								T_shbj_cnt = T_shbj_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary7.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary7.get(j))){
							if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
								C_ps_cnt = C_ps_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}else if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
								T_ps_cnt = T_ps_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary8.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary8.get(j))){
							if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
								C_zw_cnt = C_zw_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}else if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
								T_zw_cnt = T_zw_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<Ary9.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(Ary9.get(j))){
							if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
								C_ly_cnt = C_ly_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}else if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
								T_ly_cnt = T_ly_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
									p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
									l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
								}
								other_flg_1 = "Y";
								break;
							}
						}
					}
				}else{
					continue;
				}

				if(other_flg_1.equals("N")){
					if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("C")){
						C_other = C_other + ret_prd_jgeList.get(i).getDef_code1_cnt();
						if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
						}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
							l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
						}
					}else if(ret_prd_jgeList.get(i).getDef_code1_sd().equals("T")){
						T_other = T_other + ret_prd_jgeList.get(i).getDef_code1_cnt();
						if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
						}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
							l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
						}
					}
				}

			}
		}
		/**
		 * 获取最大slot_no
		 */
		if(Integer.parseInt(maxSlotNo) < Integer.parseInt(ret_prd_info.getSlot_no())){
			maxSlotNo = ret_prd_info.getSlot_no();
		}
		
		oary.setPrd_seq_id(ret_prd_info.getPrd_seq_id());
		oary.setFab_sn(ret_prd_info.getFab_sn());
		oary.setSlot_no(ret_prd_info.getSlot_no());
		oary.setPrd_grade(ret_prd_info.getPrd_grade());
		oary.setYjyc_cnt(yjyc_cnt);
		oary.setSy_cnt(sy_cnt);
		oary.setC_hs_cnt(C_hs_cnt);
		oary.setC_ad_cnt(C_ad_cnt);
		oary.setC_td_cnt(C_td_cnt);
		oary.setC_shbj_cnt(C_shbj_cnt);
		oary.setC_ps_cnt(C_ps_cnt);
		oary.setC_zw_cnt(C_zw_cnt);
		oary.setC_ly_cnt(C_ly_cnt);
		oary.setC_other(C_other);
		oary.setT_hs_cnt(T_hs_cnt);
		oary.setT_ad_cnt(T_ad_cnt);
		oary.setT_td_cnt(T_td_cnt);
		oary.setT_shbj_cnt(T_shbj_cnt);
		oary.setT_ps_cnt(T_ps_cnt);
		oary.setT_zw_cnt(T_zw_cnt);
		oary.setT_ly_cnt(T_ly_cnt);
		oary.setT_other(T_other);
		if(ret_prd_info.getDs_recipe_id() == null){
			oary.setRemark(_SPACE0);
		}else{
			oary.setRemark(ret_prd_info.getDs_recipe_id());
		}
		rtn.setObj(oary);
		outTrx.setDn_no(ret_prd_info.getDn_no());
		modelCnt = ret_prd_info.getX_axis_cnt_fk() * ret_prd_info.getY_axis_cnt_fk();
		outTrx.setModel_cnt(modelCnt);
		return rtn;
	}
	
	/**
	 * for 115客户
	 * @param ret_prd_info
	 * @return
	 */
	public SimpleRtnBeen getDefCntFor115(Ret_prd_info ret_prd_info) {
		int l_llhx_cnt = 0;
		int l_yjyc_cnt = 0;
		int l_atd_cnt = 0;
		int l_pl_cnt = 0;
		int l_hs_cnt = 0;
		int l_wj_cnt = 0;
		int l_other_cnt = 0;
		int z_hs_cnt = 0;
		int z_atd_cnt = 0;
		int z_ssbj_cnt = 0;
		int z_lw_cnt = 0;
		int z_ps_cnt = 0;
		int z_ly_cnt = 0;
		int z_wj_cnt = 0;
		int z_pit_cnt = 0;

		/**
		 * 来料不良
		 */
		//来料划X
		ArrayList<String> lAry1 = new ArrayList<String>();
		//液晶异常
		ArrayList<String> lAry2 = new ArrayList<String>();
		//凹凸点
		ArrayList<String> lAry3 = new ArrayList<String>();
		//破裂
		ArrayList<String> lAry4 = new ArrayList<String>();
		//划伤
		ArrayList<String> lAry5 = new ArrayList<String>();
		//污迹
		ArrayList<String> lAry6 = new ArrayList<String>();
		/**
		 * 制程不良
		 */
		//划伤
		ArrayList<String> zAry1 = new ArrayList<String>();
		//凹凸点
		ArrayList<String> zAry2 = new ArrayList<String>();
		//酸蚀不均
		ArrayList<String> zAry3 = new ArrayList<String>();
		//裂纹
		ArrayList<String> zAry4 = new ArrayList<String>();
		//破损
		ArrayList<String> zAry5 = new ArrayList<String>();
		//漏液
		ArrayList<String> zAry6 = new ArrayList<String>();
		//污迹
		ArrayList<String> zAry7 = new ArrayList<String>();
		//pit点
		ArrayList<String> zAry8 = new ArrayList<String>();
		
		if(inTrx.getProc_id().equals("JBQA")){//减薄QA
			lAry1.add("L014");lAry1.add("L015");
			lAry2.add("L001");lAry2.add("L018");lAry2.add("L052");lAry2.add("L013");
			lAry3.add("L009");lAry3.add("L010");lAry3.add("L053");
			lAry4.add("L002");lAry4.add("L005");
			lAry5.add("L003");
			lAry6.add("L007");
			zAry1.add("Z001");
			zAry2.add("Z039");zAry2.add("Z002");
			zAry3.add("Z011");zAry3.add("Z015");zAry3.add("Z014");
			zAry4.add("Z005");
			zAry5.add("Z004");
			zAry6.add("Z009");zAry6.add("Z010");
			zAry7.add("Z008");
			zAry8.add("Z003");
		}else{
			lAry1.add("L014");lAry1.add("L015");
			lAry2.add("L001");lAry2.add("L018");lAry2.add("L052");lAry2.add("L013");
			lAry3.add("L009");lAry3.add("L010");lAry3.add("L053");
			lAry4.add("L002");lAry4.add("L005");
			lAry5.add("L003");
			lAry6.add("L007");
			zAry1.add("Z001");
			zAry2.add("Z039");zAry2.add("Z002");
			zAry3.add("Z011");zAry3.add("Z015");
			zAry4.add("Z005");zAry4.add("Z007");
			zAry5.add("Z004");
			zAry6.add("Z009");zAry6.add("Z010");
			zAry7.add("Z008");
			zAry8.add("Z003");
		}
		SimpleRtnBeen rtn = new SimpleRtnBeen();
		Xpinqdef115 oary115 = new Xpinqdef115();
		List<Ret_prd_jge> ret_prd_jgeList = new ArrayList<Ret_prd_jge>();
		String sql = "From Ret_prd_jge WHERE id.prd_seq_id_fk = '" + ret_prd_info.getPrd_seq_id()  + "' AND lst_judge_flg='Y' AND proc_id<>'JBYZ'";
		ret_prd_jgeList = retPrdJgeDao.find(sql);
		for (int i=0;i<ret_prd_jgeList.size();i++) {
			String other_flg_1 = "N";
			if (!Util.isSpaceCheck(ret_prd_jgeList.get(i).getDef_code1())) {
				if(other_flg_1.equals("N")){
					for(int j=0;j<lAry1.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(lAry1.get(j))){
							l_llhx_cnt = l_llhx_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<lAry2.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(lAry2.get(j))){
							l_yjyc_cnt = l_yjyc_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<lAry3.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(lAry3.get(j))){
							l_atd_cnt = l_atd_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<lAry4.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(lAry4.get(j))){
							l_pl_cnt = l_pl_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<lAry5.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(lAry5.get(j))){
							l_hs_cnt = l_hs_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<lAry6.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(lAry6.get(j))){
							l_wj_cnt = l_wj_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<zAry1.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(zAry1.get(j))){
							z_hs_cnt = z_hs_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<zAry2.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(zAry2.get(j))){
							z_atd_cnt = z_atd_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<zAry3.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(zAry3.get(j))){
							z_ssbj_cnt = z_ssbj_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<zAry4.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(zAry4.get(j))){
							z_lw_cnt = z_lw_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<zAry5.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(zAry5.get(j))){
							z_ps_cnt = z_ps_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<zAry6.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(zAry6.get(j))){
							z_ly_cnt = z_ly_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<zAry7.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(zAry7.get(j))){
							z_wj_cnt = z_wj_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}
				if(other_flg_1.equals("N")){
					for(int j=0;j<zAry8.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(zAry8.get(j))){
							z_pit_cnt = z_pit_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
								p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}else if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
								l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							}
							other_flg_1 = "Y";
							break;
						}
					}
				}
				if(other_flg_1.equals("N")){
					if(ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
						l_other_cnt = l_other_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
						l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
					}
				}
			}
		}
		/**
		 * 获取最大slot_no
		 */
		if(Integer.parseInt(maxSlotNo) < Integer.parseInt(ret_prd_info.getSlot_no())){
			maxSlotNo = ret_prd_info.getSlot_no();
		}
		
		oary115.setL_llhx_cnt(l_llhx_cnt);
		oary115.setL_yjyc_cnt(l_yjyc_cnt);
		oary115.setL_atd_cnt(l_atd_cnt);
		oary115.setL_pl_cnt(l_pl_cnt);
		oary115.setL_hs_cnt(l_hs_cnt);
		oary115.setL_wj_cnt(l_wj_cnt);
		oary115.setL_other_cnt(l_other_cnt);
		oary115.setZ_hs_cnt(z_hs_cnt);
		oary115.setZ_atd_cnt(z_atd_cnt);
		oary115.setZ_ssbj_cnt(z_ssbj_cnt);
		oary115.setZ_lw_cnt(z_lw_cnt);
		oary115.setZ_ps_cnt(z_ps_cnt);
		oary115.setZ_ly_cnt(z_ly_cnt);
		oary115.setZ_wj_cnt(z_wj_cnt);
		oary115.setZ_pit_cnt(z_pit_cnt);
		oary115.setPrd_seq_id(ret_prd_info.getPrd_seq_id());
		oary115.setFab_sn(ret_prd_info.getFab_sn());
		oary115.setMtrl_box_id_fk(ret_prd_info.getMtrl_box_id_fk());
		oary115.setSlot_no(ret_prd_info.getSlot_no());
		oary115.setPrd_grade(ret_prd_info.getPrd_grade());
		if(Util.isSpaceCheck(ret_prd_info.getDs_recipe_id())){
			oary115.setRemark(_SPACE0);
		}else{
			oary115.setRemark(ret_prd_info.getDs_recipe_id());
		}
		rtn.setObj(oary115);
		outTrx.setDn_no(ret_prd_info.getDn_no());
		modelCnt = ret_prd_info.getX_axis_cnt_fk() * ret_prd_info.getY_axis_cnt_fk();
		outTrx.setModel_cnt(modelCnt);
		return rtn;
	}
	
	/**
	 * for 华南客户
	 * @param ret_prd_info
	 * @return
	 */
	public SimpleRtnBeen getDefCntForHN(Ret_prd_info ret_prd_info) {
		Integer l_hnbl_cnt= 0;// 盒内不良
		Integer l_llhx_cnt= 0;// 来料划X
		Integer l_atd_cnt= 0;// 凹凸点
		Integer l_ps_cnt= 0;// 来料破损
		Integer l_lw_cnt= 0;// 来料裂纹
		Integer l_hs_cnt= 0;// 来料划伤
		Integer l_zw_cnt= 0;// 来料脏污
		Integer l_other= 0;// 来料其他不良
		Integer z_d_atd_cnt= 0;// 制程待确认凹凸点
		Integer z_d_hs_cnt= 0;// 制程待确认划伤
		Integer z_d_ssbj_cnt= 0;// 制程待确认酸蚀不均
		Integer z_d_zw_cnt= 0;// 制程待确认脏污
		Integer z_d_ly_cnt= 0;// 制程待确认轮印
		Integer z_ps_cnt= 0;// 制程破损
		Integer z_lw_cnt= 0;// 制程裂纹
		Integer z_ly_cnt= 0;// 制程漏液
		Integer z_ls_cnt= 0;// 制程漏酸
		Integer z_fs_cnt= 0;// 制程粉碎
		Integer z_other= 0;// 制程其他不良
		/**
		 * 来料不良
		 */
		//盒内不良
		ArrayList<String> l_Ary1 = new ArrayList<String>();
		l_Ary1.add("L001");l_Ary1.add("L018");l_Ary1.add("L013");l_Ary1.add("L051");
		//来料划X
		ArrayList<String> l_Ary2 = new ArrayList<String>();
		l_Ary2.add("L014");l_Ary2.add("L015");
		//凹凸点
		ArrayList<String> l_Ary3 = new ArrayList<String>();
		l_Ary3.add("L009");l_Ary3.add("L010");l_Ary3.add("L053");l_Ary3.add("L004");l_Ary3.add("L008");
		//来料破损
		ArrayList<String> l_Ary4 = new ArrayList<String>();
		l_Ary4.add("L002");
		//来料裂纹
		ArrayList<String> l_Ary5 = new ArrayList<String>();
		l_Ary5.add("L005");
		//来料划伤
		ArrayList<String> l_Ary6 = new ArrayList<String>();
		l_Ary6.add("L003");
		//来料脏污
		ArrayList<String> l_Ary7 = new ArrayList<String>();
		l_Ary7.add("L007");
		
		/**
		 * 制程待确认
		 */
		//制程待确认凹凸点
		ArrayList<String> z_d_Ary1 = new ArrayList<String>();
		z_d_Ary1.add("Z039");z_d_Ary1.add("Z002");z_d_Ary1.add("Z003");
		//制程待确认划伤
		ArrayList<String> z_d_Ary2 = new ArrayList<String>();
		z_d_Ary2.add("Z001");
		//制程待确认酸蚀不均
		ArrayList<String> z_d_Ary3 = new ArrayList<String>();
		z_d_Ary3.add("Z011");z_d_Ary3.add("Z015");z_d_Ary3.add("Z014");
		//制程待确认脏污
		ArrayList<String> z_d_Ary4 = new ArrayList<String>();
		z_d_Ary4.add("Z008");
		//制程待确认轮印
		ArrayList<String> z_d_Ary5 = new ArrayList<String>();
		z_d_Ary5.add("L004");
		/**
		 * 制程不良
		 */
		//制程破损
		ArrayList<String> z_Ary1 = new ArrayList<String>();
		z_Ary1.add("Z004");
		//制程裂纹
		ArrayList<String> z_Ary2 = new ArrayList<String>();
		z_Ary2.add("Z005");
		//制程漏液
		ArrayList<String> z_Ary3 = new ArrayList<String>();
		z_Ary3.add("Z009");z_Ary3.add("Z006");
		//制程漏酸
		ArrayList<String> z_Ary4 = new ArrayList<String>();
		z_Ary4.add("Z010");
		//制程粉碎
		ArrayList<String> z_Ary5 = new ArrayList<String>();
		z_Ary5.add("Z007");
				
		SimpleRtnBeen rtn = new SimpleRtnBeen();
    	XpinqdefHN oaryHN = new XpinqdefHN();
		List<Ret_prd_jge> ret_prd_jgeList = new ArrayList<Ret_prd_jge>();
		String sql = "From Ret_prd_jge WHERE id.prd_seq_id_fk = '" + ret_prd_info.getPrd_seq_id()  + "' AND lst_judge_flg='Y' AND proc_id<>'JBYZ'";
		
		ret_prd_jgeList = retPrdJgeDao.find(sql);
		for (int i=0;i<ret_prd_jgeList.size();i++) {
			String other_flg_1 = "N";
			if (!Util.isSpaceCheck(ret_prd_jgeList.get(i).getDef_code1())) {
				if(other_flg_1.equals("N")){//盒内不良
					for(int j=0;j<l_Ary1.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(l_Ary1.get(j))){
							l_hnbl_cnt = l_hnbl_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//来料划X
					for(int j=0;j<l_Ary2.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(l_Ary2.get(j))){
							l_llhx_cnt = l_llhx_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//来料凹凸点
					for(int j=0;j<l_Ary3.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(l_Ary3.get(j))){
							l_atd_cnt = l_atd_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//来料破损
					for(int j=0;j<l_Ary4.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(l_Ary4.get(j))){
							l_ps_cnt = l_ps_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//来料裂纹
					for(int j=0;j<l_Ary5.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(l_Ary5.get(j))){
							l_lw_cnt = l_lw_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//来料划伤
					for(int j=0;j<l_Ary6.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(l_Ary6.get(j))){
							l_hs_cnt = l_hs_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//来料脏污
					for(int j=0;j<l_Ary7.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(l_Ary7.get(j))){
							l_zw_cnt = l_zw_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}

				if(other_flg_1.equals("N")){//制程待确认凹凸点
					for(int j=0;j<z_d_Ary1.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(z_d_Ary1.get(j))){
							z_d_atd_cnt = z_d_atd_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							d_def_cnt = d_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//制程待确认划伤
					for(int j=0;j<z_d_Ary2.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(z_d_Ary2.get(j))){
							z_d_hs_cnt = z_d_hs_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							d_def_cnt = d_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//制程待确认酸蚀不均
					for(int j=0;j<z_d_Ary3.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(z_d_Ary3.get(j))){
							z_d_ssbj_cnt = z_d_ssbj_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							d_def_cnt = d_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//制程待确认脏污
					for(int j=0;j<z_d_Ary4.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(z_d_Ary4.get(j))){
							z_d_zw_cnt = z_d_zw_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							d_def_cnt = d_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//制程待确认轮印
					for(int j=0;j<z_d_Ary5.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(z_d_Ary5.get(j))){
							z_d_ly_cnt = z_d_ly_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							d_def_cnt = d_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//制程破损
					for(int j=0;j<z_Ary1.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(z_Ary1.get(j))){
							z_ps_cnt = z_ps_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//制程裂纹
					for(int j=0;j<z_Ary2.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(z_Ary2.get(j))){
							z_lw_cnt = z_lw_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N")){//制程漏液
					for(int j=0;j<z_Ary3.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(z_Ary3.get(j))){
							z_ly_cnt = z_ly_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){//制程漏酸
					for(int j=0;j<z_Ary4.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(z_Ary4.get(j))){
							z_ls_cnt = z_ls_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				if(other_flg_1.equals("N")){//制程粉碎
					for(int j=0;j<z_Ary5.size();j++){
						if(ret_prd_jgeList.get(i).getDef_code1().equals(z_Ary5.get(j))){
							z_fs_cnt = z_fs_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
							other_flg_1 = "Y";
							break;
						}
					}
				}else{
					continue;
				}
				
				if(other_flg_1.equals("N") &&
						ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("L")){
					l_other = l_other + ret_prd_jgeList.get(i).getDef_code1_cnt();
					l_def_cnt = l_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
					other_flg_1 = "Y";
				}	
				
				if(other_flg_1.equals("N") &&
						ret_prd_jgeList.get(i).getDef_code1().substring(0, 1).equals("Z")){
					z_other = z_other + ret_prd_jgeList.get(i).getDef_code1_cnt();
					p_def_cnt = p_def_cnt + ret_prd_jgeList.get(i).getDef_code1_cnt();
					other_flg_1 = "Y";
				}	
				
			}
		}
		/**
		 * 获取最大slot_no
		 */
		if(Integer.parseInt(maxSlotNo) < Integer.parseInt(ret_prd_info.getSlot_no())){
			maxSlotNo = ret_prd_info.getSlot_no();
		}
		
		oaryHN.setPrd_seq_id(ret_prd_info.getPrd_seq_id());
		oaryHN.setFab_sn(ret_prd_info.getFab_sn());
		oaryHN.setSlot_no(ret_prd_info.getSlot_no());
		oaryHN.setL_hnbl_cnt(l_hnbl_cnt);
		oaryHN.setL_llhx_cnt(l_llhx_cnt);
		oaryHN.setL_atd_cnt(l_atd_cnt);
		oaryHN.setL_ps_cnt(l_ps_cnt);
		oaryHN.setL_lw_cnt(l_lw_cnt);
		oaryHN.setL_hs_cnt(l_hs_cnt);
		oaryHN.setL_zw_cnt(l_zw_cnt);
		oaryHN.setL_other(l_other);
		oaryHN.setZ_d_atd_cnt(z_d_atd_cnt);
		oaryHN.setZ_d_hs_cnt(z_d_hs_cnt);
		oaryHN.setZ_d_ssbj_cnt(z_d_ssbj_cnt);
		oaryHN.setZ_d_zw_cnt(z_d_zw_cnt);
		oaryHN.setZ_d_ly_cnt(z_d_ly_cnt);
		oaryHN.setZ_ps_cnt(z_ps_cnt);
		oaryHN.setZ_lw_cnt(z_lw_cnt);
		oaryHN.setZ_ly_cnt(z_ly_cnt);
		oaryHN.setZ_ls_cnt(z_ls_cnt);
		oaryHN.setZ_fs_cnt(z_fs_cnt);
		oaryHN.setZ_other(z_other);
		if(ret_prd_info.getDs_recipe_id() == null){
			oaryHN.setRemark(_SPACE0);
		}else{
			oaryHN.setRemark(ret_prd_info.getDs_recipe_id());
		}
		rtn.setObj(oaryHN);
		outTrx.setDn_no(ret_prd_info.getDn_no());
		modelCnt = ret_prd_info.getX_axis_cnt_fk() * ret_prd_info.getY_axis_cnt_fk();
		outTrx.setModel_cnt(modelCnt);
		return rtn;
	}
	
}
